This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix bootstrap on i686 (PR middle-end/69542)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Henderson <rth at redhat dot com>, Vladimir Makarov <vmakarov at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 28 Jan 2016 21:17:51 +0100
- Subject: [PATCH] Fix bootstrap on i686 (PR middle-end/69542)
- Authentication-results: sourceware.org; auth=none
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
The recent lra-remat.c change broke bootstrap for me on i686,
with comparison failure on simplify-rtx.o.
Below is a reduced testcase. debug insns really should not affect
remat decisions, before the recent changes set_bb_regs should be always a
nop on debug insns (they don't change any registers, and don't have REG_DEAD
notes). But they could have subregs of multiword regs.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
2016-01-28 Jakub Jelinek <jakub@redhat.com>
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.
--- gcc/lra-remat.c.jj 2016-01-28 15:07:24.000000000 +0100
+++ gcc/lra-remat.c 2016-01-28 18:24:43.778297120 +0100
@@ -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);
}
--- gcc/testsuite/gcc.dg/torture/pr69542.c.jj 2016-01-28 18:54:49.477968076 +0100
+++ gcc/testsuite/gcc.dg/torture/pr69542.c 2016-01-28 18:55:16.786599654 +0100
@@ -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);
+}
Jakub