I've bootstrapped and tested the followgn safe patch on x86_64-unknown-linux-gnu.
Applied. Richard. 2016-02-01 Richard Biener <rguent...@suse.de> PR tree-optimization/69574 * tree-chrec.c (hide_evolution_in_other_loops_than_loop): Instead of asserting return chrec_dont_know. * gcc.dg/torture/pr69574.c: New testcase. Index: gcc/tree-chrec.c =================================================================== *** gcc/tree-chrec.c (revision 233033) --- gcc/tree-chrec.c (working copy) *************** hide_evolution_in_other_loops_than_loop *** 728,739 **** /* There is no evolution in this loop. */ return initial_condition (chrec); else ! { ! gcc_assert (flow_loop_nested_p (loop, chloop)); ! return hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec), ! loop_num); ! } default: return chrec; --- 728,739 ---- /* There is no evolution in this loop. */ return initial_condition (chrec); + else if (flow_loop_nested_p (loop, chloop)) + return hide_evolution_in_other_loops_than_loop (CHREC_LEFT (chrec), + loop_num); + else ! return chrec_dont_know; default: return chrec; Index: gcc/testsuite/gcc.dg/torture/pr69574.c =================================================================== *** gcc/testsuite/gcc.dg/torture/pr69574.c (revision 0) --- gcc/testsuite/gcc.dg/torture/pr69574.c (working copy) *************** *** 0 **** --- 1,15 ---- + /* { dg-do compile } */ + + typedef unsigned mytype; + + struct S { + mytype *pu; + }; + + mytype f(struct S *e) + { + mytype x; + if(&x != e->pu) + __builtin_memcpy(&x, e->pu, sizeof(unsigned)); + return x; + }