This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/81455] [7/8 Regression] Compile-time hog w/ -O1 -funswitch-loops
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Jul 2017 10:57:59 +0000
- Subject: [Bug tree-optimization/81455] [7/8 Regression] Compile-time hog w/ -O1 -funswitch-loops
- Auto-submitted: auto-generated
- References: <bug-81455-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81455
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ok, so we end up running in circles in find_loop_guard
gcond *cond;
do
{
if (single_succ_p (header))
header = single_succ (header);
else
{
cond = dyn_cast <gcond *> (last_stmt (header));
if (! cond)
return NULL;
extract_true_false_edges_from_block (header, &te, &fe);
/* Make sure to skip earlier hoisted guards that are left
in place as if (true). */
if (gimple_cond_true_p (cond))
header = te->dest;
else if (gimple_cond_false_p (cond))
header = fe->dest;
else
break;
}
}
while (1);
for
<bb 4> [85.00%] [count: INV] [loop 3 header]:
if (1 != 0)
goto <bb 9>; [85.00%] [count: INV]
else
goto <bb 11>; [15.00%] [count: INV]
<bb 11> [12.75%] [count: INV]:
goto <bb 5>; [100.00%] [count: INV]
<bb 9> [72.25%] [count: INV] [loop 3 latch]:
goto <bb 4>; [100.00%] [count: INV]
where we walk a latch. We never should do that.