Commit 1aa54f90 by Richard Biener Committed by Richard Biener

re PR tree-optimization/81455 (Compile-time hog w/ -O1 -funswitch-loops)

2017-07-25  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/81455
	* tree-ssa-loop-unswitch.c (find_loop_guard): Make sure to
	not walk in cycles when looking for guards.

	* gcc.dg/pr81455.c: New testcase.

From-SVN: r250518
parent e294f495
2017-07-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/81455
* tree-ssa-loop-unswitch.c (find_loop_guard): Make sure to
not walk in cycles when looking for guards.
2017-07-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/81529
* tree-vect-stmts.c (process_use): Disregard live induction PHIs
when optimizing backedge uses.
......
2017-07-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/81455
* gcc.dg/pr81455.c: New testcase.
2017-07-25 Richard Biener <rguenther@suse.de>
PR tree-optimization/81529
* gfortran.dg/pr81529.f90: New testcase.
......
/* { dg-do compile } */
/* { dg-options "-O -funswitch-loops" } */
void
jh (unsigned int aw, int sn)
{
int xs;
for (xs = 0; xs < 1; ++xs)
aw &= 1;
while (aw < 1 || ++sn < 1)
{
}
}
......@@ -582,8 +582,9 @@ find_loop_guard (struct loop *loop)
gcond *cond;
do
{
basic_block next = NULL;
if (single_succ_p (header))
header = single_succ (header);
next = single_succ (header);
else
{
cond = dyn_cast <gcond *> (last_stmt (header));
......@@ -593,12 +594,16 @@ find_loop_guard (struct loop *loop)
/* Make sure to skip earlier hoisted guards that are left
in place as if (true). */
if (gimple_cond_true_p (cond))
header = te->dest;
next = te->dest;
else if (gimple_cond_false_p (cond))
header = fe->dest;
next = fe->dest;
else
break;
}
/* Never traverse a backedge. */
if (header->loop_father->header == next)
return NULL;
header = next;
}
while (1);
if (!flow_bb_inside_loop_p (loop, te->dest)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment