OSDN Git Service

* toplev.c (rest_of_compilation): Recompute register usage after
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Feb 2003 19:18:54 +0000 (19:18 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 Feb 2003 19:18:54 +0000 (19:18 +0000)
split_all_insns.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@62607 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20030209-1.c [new file with mode: 0644]
gcc/toplev.c

index 7188c9f..826f092 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-09  Richard Sandiford  <rsandifo@redhat.com>
+
+       * toplev.c (rest_of_compilation): Recompute register usage after
+       split_all_insns.
+
 2003-02-09  Richard Henderson  <rth@redhat.com>
 
        * libgcc-std.ver (__clztf2): New.
index 781af01..8b58ea6 100644 (file)
@@ -1,3 +1,7 @@
+2002-02-09  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gcc.c-torture/execute/20030209-1.c: New test.
+
 2003-02-09  Kazu Hirata  <kazu@cs.umass.edu>
 
        * gcc.c-torture/execute/builtin-bitops-1.c: When testing the
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030209-1.c b/gcc/testsuite/gcc.c-torture/execute/20030209-1.c
new file mode 100644 (file)
index 0000000..c6aa77d
--- /dev/null
@@ -0,0 +1,11 @@
+double x[100][100];
+int main ()
+{
+  int i;
+
+  i = 99;
+  x[i][0] = 42;
+  if (x[99][0] != 42)
+    abort ();
+  exit (0);
+}
index 840632a..a4cd1df 100644 (file)
@@ -2373,7 +2373,6 @@ rest_of_compilation (decl)
   int tem;
   int failure = 0;
   int rebuild_label_notes_after_reload;
-  int register_life_up_to_date;
 
   timevar_push (TV_REST_OF_COMPILATION);
 
@@ -3227,10 +3226,6 @@ rest_of_compilation (decl)
      description to add extra information not needed previously.  */
   split_all_insns (1);
 
-  /* Any of the several passes since flow1 will have munged register
-     lifetime data a bit.  */
-  register_life_up_to_date = 0;
-
 #ifdef OPTIMIZE_MODE_SWITCHING
   timevar_push (TV_MODE_SWITCH);
 
@@ -3241,6 +3236,11 @@ rest_of_compilation (decl)
   timevar_pop (TV_MODE_SWITCH);
 #endif
 
+  /* Any of the several passes since flow1 will have munged register
+     lifetime data a bit.  We need it to be up to date for scheduling
+     (see handling of reg_known_equiv in init_alias_analysis).  */
+  recompute_reg_usage (insns, !optimize_size);
+
   timevar_push (TV_SCHED);
 
 #ifdef INSN_SCHEDULING
@@ -3257,10 +3257,6 @@ rest_of_compilation (decl)
       schedule_insns (rtl_dump_file);
 
       close_dump_file (DFI_sched, print_rtl_with_bb, insns);
-
-      /* Register lifetime information was updated as part of verifying
-        the schedule.  */
-      register_life_up_to_date = 1;
     }
 #endif
   timevar_pop (TV_SCHED);
@@ -3280,9 +3276,6 @@ rest_of_compilation (decl)
      RUN_JUMP_AFTER_RELOAD records whether or not we need to rerun the
      jump optimizer after register allocation and reloading are finished.  */
 
-  if (! register_life_up_to_date)
-    recompute_reg_usage (insns, ! optimize_size);
-
   if (flag_new_regalloc)
     {
       delete_trivially_dead_insns (insns, max_reg_num ());