Message ID | 20101102234327.GN29412@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
> 2010-11-01 Jakub Jelinek <jakub@redhat.com> > > PR debug/46252 > * reload1.c (delete_dead_insn): Use prev_active_insn instead of > prev_real_insn. > * gcse.c (insert_insn_end_basic_block): Likewise. > > * gcc.dg/pr46252.c: New test. OK, thanks.
> So far I have done 3) from the above list, bootstrapped/regtested on > x86_64-linux and i686-linux, getting tired so I've postponed the rest for > later on, will try to get to it soon. While the 3rd use of prev_real_insn in the middle-end has disappeared in the meantime, it turns out that it is used in several back-ends.
--- gcc/reload1.c.jj 2010-11-01 09:07:24.000000000 +0100 +++ gcc/reload1.c 2010-11-01 15:39:21.000000000 +0100 @@ -2112,7 +2112,7 @@ spill_failure (rtx insn, enum reg_class static void delete_dead_insn (rtx insn) { - rtx prev = prev_real_insn (insn); + rtx prev = prev_active_insn (insn); rtx prev_dest; /* If the previous insn sets a register that dies in our insn, delete it --- gcc/gcse.c.jj 2010-09-13 20:54:20.000000000 +0200 +++ gcc/gcse.c 2010-11-02 22:37:14.022260983 +0100 @@ -3574,7 +3574,7 @@ insert_insn_end_basic_block (struct expr the new instruction just before the tablejump. */ if (GET_CODE (PATTERN (insn)) == ADDR_VEC || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC) - insn = prev_real_insn (insn); + insn = prev_active_insn (insn); #ifdef HAVE_cc0 /* FIXME: 'twould be nice to call prev_cc0_setter here but it aborts --- gcc/testsuite/gcc.dg/pr46252.c.jj 2010-11-01 16:12:22.000000000 +0100 +++ gcc/testsuite/gcc.dg/pr46252.c 2010-11-01 16:12:07.000000000 +0100 @@ -0,0 +1,15 @@ +/* PR debug/46252 */ +/* { dg-do compile } */ +/* { dg-options "-O -frerun-cse-after-loop -fno-tree-loop-optimize -funroll-loops -fcompare-debug" } */ + +void +foo (float *f) +{ + int i; + for (i = 0; i < 4; i++) + f[i] = i; + bar (); + for (i = 0; i < 4; i++) + if (f[i] != i) + __builtin_abort (); +}