This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: outof-ssa vs. -fnon-call-exceptions: known problem?
- From: "Diego Novillo" <dnovillo at google dot com>
- To: gcc at gcc dot gnu dot org, rsandifo at nildram dot co dot uk
- Date: Sat, 29 Sep 2007 13:13:46 -0400
- Subject: Re: outof-ssa vs. -fnon-call-exceptions: known problem?
- References: <873awxivs7.fsf@firetop.home>
On 9/29/07, Richard Sandiford <rsandifo@nildram.co.uk> 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 <dnovillo@google.com>
* 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)