Commit 94172876 by Richard Sandiford Committed by Richard Sandiford

re PR tree-optimization/33615 (Hoisting of potentially-throwing values for -fnon-call-exceptions)

gcc/
	PR tree-optimization/33615
	* tree-ssa-loop-im.c (movement_possibility): Return MOVE_IMPOSSIBLE
	if the rhs might throw.

gcc/testsuite/
	PR tree-optimization/33615
	* g++.dg/tree-ssa/pr33615.C: New test.

From-SVN: r129163
parent edbed3d3
2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk>
PR tree-optimization/33615
* tree-ssa-loop-im.c (movement_possibility): Return MOVE_IMPOSSIBLE
if the rhs might throw.
2007-10-09 Jan Hubicka <jh@suse.cz>
* invoke.texi (align-threshold, align-loop-iterations): Document.
2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk>
PR tree-optimization/33615
* g++.dg/tree-ssa/pr33615.C: New test.
2007-10-08 Alexandre Oliva <aoliva@redhat.com>
PR tree-optimization/33572
/* { dg-do compile } */
/* { dg-options "-O -fnon-call-exceptions -fdump-tree-lim-details -w" } */
extern volatile int y;
double
foo (double a, int x)
{
while (x--)
{
y++;
a += 1.0 / 0.0;
}
return a;
}
// The expression 1.0 / 0.0 should not be treated as a loop invariant
// if it may throw an exception.
// { dg-final { scan-tree-dump-times "invariant up to" 0 "lim" } }
// { dg-final { cleanup-tree-dump "lim" } }
......@@ -260,7 +260,8 @@ movement_possibility (tree stmt)
rhs = GIMPLE_STMT_OPERAND (stmt, 1);
if (TREE_SIDE_EFFECTS (rhs))
if (TREE_SIDE_EFFECTS (rhs)
|| tree_could_throw_p (rhs))
return MOVE_IMPOSSIBLE;
if (TREE_CODE (lhs) != SSA_NAME
......
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