Commit 46e58e18 by Richard Biener Committed by Richard Biener

re PR tree-optimization/85284 (Loop miscompilation starting with r238367)

2018-04-09  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/85284
	* tree-ssa-loop-niter.c (number_of_iterations_exit_assumptions):
	Only use the niter constraining form of simple_iv when the exit
	is always executed.

	* gcc.dg/torture/pr85284.c: New testcase.

From-SVN: r259234
parent f04fd903
2018-04-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/85284
* tree-ssa-loop-niter.c (number_of_iterations_exit_assumptions):
Only use the niter constraining form of simple_iv when the exit
is always executed.
2018-04-09 Tom de Vries <tom@codesourcery.com>
PR target/84041
......
2018-04-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/85284
* gcc.dg/torture/pr85284.c: New testcase.
2018-04-09 Andrey Belevantsev <abel@ispras.ru>
PR rtl-optimization/80463
......
/* { dg-do run } */
static int p[48], v;
int
main ()
{
p[32] = 1;
for (int i = 48; i--;)
{
if (!p[i])
continue;
if ((i & 7) > 2)
break;
v = i & 1;
}
if (v != 0)
__builtin_abort ();
return 0;
}
......@@ -2356,11 +2356,11 @@ number_of_iterations_exit_assumptions (struct loop *loop, edge exit,
tree iv0_niters = NULL_TREE;
if (!simple_iv_with_niters (loop, loop_containing_stmt (stmt),
op0, &iv0, &iv0_niters, false))
op0, &iv0, safe ? &iv0_niters : NULL, false))
return false;
tree iv1_niters = NULL_TREE;
if (!simple_iv_with_niters (loop, loop_containing_stmt (stmt),
op1, &iv1, &iv1_niters, false))
op1, &iv1, safe ? &iv1_niters : NULL, false))
return false;
/* Give up on complicated case. */
if (iv0_niters && iv1_niters)
......
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