Message ID | 20110308153304.GA30899@tyan-ft48-01.lab.bos.redhat.com |
---|---|
State | New |
Headers | show |
On 03/08/2011 10:33 AM, Jakub Jelinek wrote: > Hi! > > If delete_trivially_dead_insns deletes some insn, DF state might be > out of date, and, what's worse, if there are pseudos set multiple times > referenced in debug_insns, where the debug_insn references were ok > before the deletions, but the deletions shortened lifetime of such a pseudo > in certain location, nothing resets the debug insns afterwards and we end up > with -fcompare-debug failures because the lifetime of the pseudos is > different between -g0 and -g. > > Fixed by rerunning df_analyze () if delete_trivially_dead_insns removed > anything, bootstrapped/regtested on x86_64-linux and i686-linux. > Ok for trunk? > Ok for me. Thanks for the patch, Jakub. > 2011-03-07 Jakub Jelinek<jakub@redhat.com> > > PR debug/47881 > * ira.c (ira): Call df_analyze again if delete_trivially_dead_insns > removed anything. > > * gcc.dg/pr47881.c: New test. > > --- gcc/ira.c.jj 2011-02-21 15:37:42.000000000 +0100 > +++ gcc/ira.c 2011-03-07 12:33:59.000000000 +0100 > @@ -3232,7 +3232,8 @@ ira (FILE *f) > check_allocation (); > #endif > > - delete_trivially_dead_insns (get_insns (), max_reg_num ()); > + if (delete_trivially_dead_insns (get_insns (), max_reg_num ())) > + df_analyze (); > > init_reg_equiv_memory_loc (); > > --- gcc/testsuite/gcc.dg/pr47881.c.jj 2011-03-08 14:12:04.000000000 +0100 > +++ gcc/testsuite/gcc.dg/pr47881.c 2011-03-08 14:11:46.000000000 +0100 > @@ -0,0 +1,24 @@ > +/* PR debug/47881 */ > +/* { dg-do compile } */ > +/* { dg-options "-O -fcompare-debug -fno-dce -funroll-loops -fno-web" } */ > + > +extern int data[]; > + > +int > +foo (int *t, int *f, int n) > +{ > + int i = 0, a, b, c, d; > + while (data[*f]&& n) > + n--; > + for (; i< n; i += 4) > + { > + a = data[*(f++)& 0x7f]; > + c = data[*(f++)& 0x7f]; > + c = data[*(f++)& 0x7f]; > + d = data[*(f++)& 0x7f]; > + if ((a& 0x80) || (b& 0x80) || (c& 0x80) || (d& 0x80)) > + return 1; > + *(t++) = 16; > + } > + return 0; > +} > > Jakub
different between -g0 and -g. Fixed by rerunning df_analyze () if delete_trivially_dead_insns removed anything, bootstrapped/regtested on x86_64-linux and i686-linux. Ok for trunk? 2011-03-07 Jakub Jelinek <jakub@redhat.com> PR debug/47881 * ira.c (ira): Call df_analyze again if delete_trivially_dead_insns removed anything. * gcc.dg/pr47881.c: New test. --- gcc/ira.c.jj 2011-02-21 15:37:42.000000000 +0100 +++ gcc/ira.c 2011-03-07 12:33:59.000000000 +0100 @@ -3232,7 +3232,8 @@ ira (FILE *f) check_allocation (); #endif - delete_trivially_dead_insns (get_insns (), max_reg_num ()); + if (delete_trivially_dead_insns (get_insns (), max_reg_num ())) + df_analyze (); init_reg_equiv_memory_loc (); --- gcc/testsuite/gcc.dg/pr47881.c.jj 2011-03-08 14:12:04.000000000 +0100 +++ gcc/testsuite/gcc.dg/pr47881.c 2011-03-08 14:11:46.000000000 +0100 @@ -0,0 +1,24 @@ +/* PR debug/47881 */ +/* { dg-do compile } */ +/* { dg-options "-O -fcompare-debug -fno-dce -funroll-loops -fno-web" } */ + +extern int data[]; + +int +foo (int *t, int *f, int n) +{ + int i = 0, a, b, c, d; + while (data[*f] && n) + n--; + for (; i < n; i += 4) + { + a = data[*(f++) & 0x7f]; + c = data[*(f++) & 0x7f]; + c = data[*(f++) & 0x7f]; + d = data[*(f++) & 0x7f]; + if ((a & 0x80) || (b & 0x80) || (c & 0x80) || (d & 0x80)) + return 1; + *(t++) = 16; + } + return 0; +}