OSDN Git Service

Nullify regno_allocno_map of the removed allocno.
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 May 2010 14:02:43 +0000 (14:02 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 May 2010 14:02:43 +0000 (14:02 +0000)
gcc/

2010-05-10  H.J. Lu<hongjiu.lu@intel.com>
    Vladimir Makarov<vmakarov@redhat.com>

PR rtl-optimization/44012
* ira-build.c (remove_unnecessary_allocnos): Nullify
regno_allocno_map of the removed allocno.

gcc/testsuite/

2010-05-10  H.J. Lu  <hongjiu.lu@intel.com>

PR rtl-optimization/44012
* gcc.dg/pr44012.c: New.

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

gcc/ChangeLog
gcc/ira-build.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr44012.c [new file with mode: 0644]

index 7a03e15..86156f7 100644 (file)
@@ -1,3 +1,10 @@
+2010-05-10  H.J. Lu<hongjiu.lu@intel.com>
+           Vladimir Makarov<vmakarov@redhat.com>
+
+       PR rtl-optimization/44012
+       * ira-build.c (remove_unnecessary_allocnos): Nullify
+       regno_allocno_map of the removed allocno.
+
 2010-05-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * configure.ac (gcc_cv_ld_eh_gc_sections): Redirect objdump errors
index 16909a9..c879efa 100644 (file)
@@ -1978,6 +1978,10 @@ remove_unnecessary_allocnos (void)
                  merged_p = true;
                  ALLOCNO_LIVE_RANGES (a) = NULL;
                  propagate_some_info_from_allocno (parent_a, a);
+                 /* Remove it from the corresponding regno allocno
+                    map to avoid info propagation of subsequent
+                    allocno into this already removed allocno.  */
+                 a_node->regno_allocno_map[regno] = NULL;
                  finish_allocno (a);
                }
            }
index b15c23f..3208c84 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-10  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR rtl-optimization/44012
+       * gcc.dg/pr44012.c: New.
+
 2010-05-10  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * lib/lto.exp (lto_prune_vis_warns): Renamed to lto_prune_warns.
diff --git a/gcc/testsuite/gcc.dg/pr44012.c b/gcc/testsuite/gcc.dg/pr44012.c
new file mode 100644 (file)
index 0000000..bd255ba
--- /dev/null
@@ -0,0 +1,58 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fgcse" } */
+
+extern void fe ();
+
+extern int i;
+
+static inline void
+FX (void (*f) ())
+{
+  fe ();
+  (*f) ();
+}
+
+static inline void
+f4 ()
+{
+  for (;;)
+    switch (i)
+      {
+      case 306:
+      FX (&fe);
+      break;
+      default:
+      return;
+      }
+}
+
+static inline void
+f3 ()
+{
+  f4 ();
+  for (;;)
+    switch (i)
+      {
+      case 267:
+      FX (&f4);
+      break;
+      default:
+      return;
+      }
+}
+
+static inline void
+f2 ()
+{
+  f3 ();
+  while (i)
+    FX (&f3);
+}
+
+void
+f1 ()
+{
+  f2 ();
+  while (1)
+    FX (&f2);
+}