]> gcc.gnu.org Git - gcc.git/commitdiff
re PR rtl-optimization/27073 (invalid gcse manipulation of REG_EQUIV notes)
authorRichard Sandiford <richard@codesourcery.com>
Sun, 9 Apr 2006 10:06:20 +0000 (10:06 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 9 Apr 2006 10:06:20 +0000 (10:06 +0000)
PR rtl-optimization/27073
* gcse.c (try_replace_reg): Just propagate into REG_EQUAL notes,
not REG_EQUIVs.

gcc/testsuite/
* gcc.c-torture/execute/pr27073.c: New test.

From-SVN: r112803

gcc/ChangeLog
gcc/gcse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr27073.c [new file with mode: 0644]

index e344f9eff14876af2acd464761f184af51637ddb..60ce7403951d47b10ff4c22e7d1f8656a7db05b6 100644 (file)
@@ -1,3 +1,9 @@
+2006-04-09  Richard Sandiford  <richard@codesourcery.com>
+
+       PR rtl-optimization/27073
+       * gcse.c (try_replace_reg): Just propagate into REG_EQUAL notes,
+       not REG_EQUIVs.
+
 2006-04-08  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree.h (tree_memory_tag): Add old_used_alone.
index f0e25a214ea34535c9087b979d2c24b27b1d1ceb..0dbbe0bb6e1fdc0898eba3ddca1412b31954d1d2 100644 (file)
@@ -2642,7 +2642,7 @@ find_used_regs (rtx *xptr, void *data ATTRIBUTE_UNUSED)
 static int
 try_replace_reg (rtx from, rtx to, rtx insn)
 {
-  rtx note = find_reg_equal_equiv_note (insn);
+  rtx note = find_reg_note (insn, REG_EQUAL, NULL);
   rtx src = 0;
   int success = 0;
   rtx set = single_set (insn);
index 3492c4bc33d88f76cc848168dae51efea2d7c288..41ba91e905c34d5310b0c19db1cf86035d785557 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-09  Richard Sandiford  <richard@codesourcery.com>
+
+       PR rtl-optimization/27073
+       * gcc.c-torture/execute/pr27073.c: New test.
+
 2006-04-08  Mike Stump  <mrs@apple.com>
 
        * gcc.dg/pragma-darwin.c: Improve for ppc64.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr27073.c b/gcc/testsuite/gcc.c-torture/execute/pr27073.c
new file mode 100644 (file)
index 0000000..a58e9ac
--- /dev/null
@@ -0,0 +1,25 @@
+void __attribute__((noinline))
+foo (int *p, int d1, int d2, int d3,
+     short count, int s1, int s2, int s3, int s4, int s5)
+{
+  int n = count;
+  while (n--)
+    {
+      *p++ = s1;
+      *p++ = s2;
+      *p++ = s3;
+      *p++ = s4;
+      *p++ = s5;
+    }
+}
+
+int main()
+{
+  int x[10], i;
+
+  foo (x, 0, 0, 0, 2, 100, 200, 300, 400, 500);
+  for (i = 0; i < 10; i++)
+    if (x[i] != (i % 5 + 1) * 100)
+      abort ();
+  exit (0);
+}
This page took 0.116075 seconds and 5 git commands to generate.