diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e344f9eff14876af2acd464761f184af51637ddb..60ce7403951d47b10ff4c22e7d1f8656a7db05b6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/gcse.c b/gcc/gcse.c index f0e25a214ea34535c9087b979d2c24b27b1d1ceb..0dbbe0bb6e1fdc0898eba3ddca1412b31954d1d2 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3492c4bc33d88f76cc848168dae51efea2d7c288..41ba91e905c34d5310b0c19db1cf86035d785557 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000000000000000000000000000000000000..a58e9acae6093d0f3c4e9a34e49035ce1f5c6c46 --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/execute/pr27073.c @@ -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); +}