This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: outof-ssa vs. -fnon-call-exceptions: known problem?


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]