From: Jakub Jelinek Date: Thu, 28 Jan 2016 21:01:51 +0000 (+0100) Subject: re PR middle-end/69542 (-fcompare-debug failure in simplify-rtx.c on i?86 since r232905) X-Git-Tag: basepoints/gcc-7~1239 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb1b1f01560b2d2d3d2c17ce4c37f97b1396952c;p=thirdparty%2Fgcc.git re PR middle-end/69542 (-fcompare-debug failure in simplify-rtx.c on i?86 since r232905) PR middle-end/69542 * lra-remat.c (calculate_local_reg_remat_bb_data): Only consider non-debug insns. * gcc.dg/torture/pr69542.c: New test. From-SVN: r232946 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c2df5a036fcf..4df81d56a199 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-01-28 Jakub Jelinek + + PR middle-end/69542 + * lra-remat.c (calculate_local_reg_remat_bb_data): Only consider + non-debug insns. + 2016-01-28 Pat Haugen * config/rs6000/rs6000.c (output_cbranch): Don't statically predict diff --git a/gcc/lra-remat.c b/gcc/lra-remat.c index 4d8099fcd8e1..e729ea93298f 100644 --- a/gcc/lra-remat.c +++ b/gcc/lra-remat.c @@ -694,7 +694,7 @@ calculate_local_reg_remat_bb_data (void) FOR_EACH_BB_FN (bb, cfun) FOR_BB_INSNS (bb, insn) - if (INSN_P (insn)) + if (NONDEBUG_INSN_P (insn)) set_bb_regs (bb, insn); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6e5e21881536..a378dd62ca4b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-01-28 Jakub Jelinek + + PR middle-end/69542 + * gcc.dg/torture/pr69542.c: New test. + 2016-01-28 Wilco Dijkstra * gcc.target/aarch64/ccmp_1.c: Fix test issue. diff --git a/gcc/testsuite/gcc.dg/torture/pr69542.c b/gcc/testsuite/gcc.dg/torture/pr69542.c new file mode 100644 index 000000000000..ced5c326ac87 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr69542.c @@ -0,0 +1,37 @@ +/* PR middle-end/69542 */ +/* { dg-do compile } */ +/* { dg-additional-options "-fcompare-debug" } */ + +typedef struct A *B; +extern int *a[]; +struct C { B b; struct D *d; }; +struct A { struct { struct C e[1]; long long f[1]; } u; }; +struct D { int g; B h[100]; }; +int b, c, e, g; +B d, f; +void foo (void) __attribute__ ((__noreturn__)); +int bar (void) +{ + int i = 0; + do + { + if ('E' && a[e][0] != 'V') + foo (); + struct D *k = d->u.e[0].d; + B x = k->h[i], o = f->u.e[0].b; + if (b) + return 0; + if (a[g][0] != 'E' && a[g][0] != 'V') + foo (); + struct D *n = o->u.e[0].d; + int r = x->u.f[0]; + (void) r; + if (c) + foo (); + B y = n->h[x->u.f[0]]; + if (i != y->u.f[0]) + return 0; + i++; + } + while (1); +}