On 9/29/07, Richard Sandiford <[EMAIL PROTECTED]> wrote:
> Is this a known problem? (I tried to find it in bugzilla, but couldn't)
I can reproduce it on x86_64 as well. The 1/0 statement should not be
considered replaceable by out-of-ssa. Could you file a bug for this?
This patch should fix it. Still being tested:
2007-09-29 Diego Novillo <[EMAIL PROTECTED]>
* tree-ssa-ter.c (is_replaceable_p): Return false if STMT may
throw an exception.
Index: tree-ssa-ter.c
===================================================================
--- tree-ssa-ter.c (revision 128881)
+++ tree-ssa-ter.c (working copy)
@@ -366,6 +366,10 @@ is_replaceable_p (tree stmt)
if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
return false;
+ /* If the statement may throw an exception, it cannot be replaced. */
+ if (tree_could_throw_p (stmt))
+ return false;
+
/* Punt if there is more than 1 def. */
def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
if (!def)