https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78731
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Wed Dec 14 10:31:37 2016 New Revision: 243641 URL: https://gcc.gnu.org/viewcvs?rev=243641&root=gcc&view=rev Log: 2016-12-14 Richard Biener <rguent...@suse.de> PR tree-optimization/78731 * tree-ssa-threadedge.c (simplify_control_stmt_condition): If we've seen a backedge to not walk the SSA value chain. (thread_around_empty_blocks): Pass down whether we've seen a backedge to simplify_control_stmt_condition. (thread_through_normal_block): Likewise. * gcc.dg/torture/pr78731.c: New testcase. Added: branches/gcc-5-branch/gcc/testsuite/gcc.dg/torture/pr78731.c Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/testsuite/ChangeLog branches/gcc-5-branch/gcc/tree-ssa-threadedge.c