Commit 05c42b11 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-pre.c (compute_avail): Don't call make_values_for_stmt
	if the statement might throw.  Fix formatting.

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

From-SVN: r129164
parent 94172876
2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk> 2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk>
PR tree-optimization/33615 PR tree-optimization/33615
* tree-ssa-pre.c (compute_avail): Don't call make_values_for_stmt
if the statement might throw. Fix formatting.
2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk>
PR tree-optimization/33615
* tree-ssa-loop-im.c (movement_possibility): Return MOVE_IMPOSSIBLE * tree-ssa-loop-im.c (movement_possibility): Return MOVE_IMPOSSIBLE
if the rhs might throw. if the rhs might throw.
2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk> 2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk>
PR tree-optimization/33615 PR tree-optimization/33615
* g++.dg/tree-ssa/pr33615-2.C: New test.
2007-10-09 Richard Sandiford <rsandifo@nildram.co.uk>
PR tree-optimization/33615
* g++.dg/tree-ssa/pr33615.C: New test. * g++.dg/tree-ssa/pr33615.C: New test.
2007-10-08 Alexandre Oliva <aoliva@redhat.com> 2007-10-08 Alexandre Oliva <aoliva@redhat.com>
/* { dg-do compile } */
/* { dg-options "-O2 -fnon-call-exceptions -fdump-tree-pre-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 "Replaced 1\\\.0e\\\+0 / 0\\\.0" 0 "pre" } }
// { dg-final { cleanup-tree-dump "pre" } }
...@@ -3555,10 +3555,11 @@ compute_avail (void) ...@@ -3555,10 +3555,11 @@ compute_avail (void)
} }
else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
&& !ann->has_volatile_ops && !ann->has_volatile_ops
&& TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI && (!SSA_NAME_OCCURS_IN_ABNORMAL_PHI
(GIMPLE_STMT_OPERAND (stmt, 0))) (GIMPLE_STMT_OPERAND (stmt, 0)))
&& !tree_could_throw_p (stmt))
{ {
if (make_values_for_stmt (stmt, block)) if (make_values_for_stmt (stmt, block))
continue; continue;
......
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