On 2016.11.18 at 10:27 -0600, Bill Schmidt wrote: > =================================================================== > --- gcc/testsuite/gcc.dg/tree-ssa/pr78413.c (revision 0) > +++ gcc/testsuite/gcc.dg/tree-ssa/pr78413.c (working copy) > @@ -0,0 +1,35 @@ > +/* PR78413. These previously failed in tree if-conversion due to a loop > + latch with multiple predecessors that the code did not anticipate. */ > +/* { dg-do compile } */ > +/* { dg-options "-O3 -ffast-math" } */
Please add -fno-strict-aliasing, otherwise fn1() wouldn't ICE. > +extern long long int llrint(double x); > +int a; > +double b; > +__attribute__((cold)) void decode_init() { > + int c, d = 0; > + for (; d < 12; d++) { > + if (d) > + b = 0; > + c = 0; > + for (; c < 6; c++) > + a = b ? llrint(b) : 0; > + } > +} > + > +struct S { > + _Bool bo; > +}; > +int a, bb, c, d; > +void fn1() { > + do > + do > + do { > + struct S *e = (struct S *)1; > + do > + bb = a / (e->bo ? 2 : 1); > + while (bb); > + } while (0); > + while (d); > + while (c); > +} -- Markus