Commit 2359e571 by Bin Cheng Committed by Bin Cheng

re PR tree-optimization/70715 (SCEV failed to prove no-overflow-ness information unsigned loop IV)

	PR tree-optimization/70715
	* tree-ssa-loop-niter.c (loop_exits_before_overflow): Check equality
	after expanding BASE using expand_simple_operations.

	gcc/testsuite/ChangeLog
	PR tree-optimization/70715
	* gcc.dg/tree-ssa/scev-13.c: New test.

From-SVN: r235333
parent ce0e66ff
2016-04-21 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/70715
* tree-ssa-loop-niter.c (loop_exits_before_overflow): Check equality
after expanding BASE using expand_simple_operations.
2016-04-21 Marc Glisse <marc.glisse@inria.fr> 2016-04-21 Marc Glisse <marc.glisse@inria.fr>
* match.pd (min(-x, -y), max(-x, -y), min(~x, ~y), max(~x, ~y)): * match.pd (min(-x, -y), max(-x, -y), min(~x, ~y), max(~x, ~y)):
......
2016-04-21 Bin Cheng <bin.cheng@arm.com>
PR tree-optimization/70715
* gcc.dg/tree-ssa/scev-13.c: New test.
2016-04-21 Marc Glisse <marc.glisse@inria.fr> 2016-04-21 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/tree-ssa/minmax-2.c: New testcase. * gcc.dg/tree-ssa/minmax-2.c: New testcase.
......
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-ldist" } */
int
foo (char *p, unsigned n)
{
while(n--)
{
p[n]='A';
}
return 0;
}
/* Loop can be transformed into builtin memset since &p[n] is SCEV. */
/* { dg-final { scan-tree-dump "builtin_memset" "ldist" } } */
...@@ -4141,7 +4141,11 @@ loop_exits_before_overflow (tree base, tree step, ...@@ -4141,7 +4141,11 @@ loop_exits_before_overflow (tree base, tree step,
continue; continue;
/* Done proving if this is a no-overflow control IV. */ /* Done proving if this is a no-overflow control IV. */
if (operand_equal_p (base, civ->base, 0)) if (operand_equal_p (base, civ->base, 0)
/* Control IV is recorded after expanding simple operations,
Here we compare it against expanded base too. */
|| operand_equal_p (expand_simple_operations (base),
civ->base, 0))
return true; return true;
/* If this is a before stepping control IV, in other words, we have /* If this is a before stepping control IV, in other words, we have
......
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