------- Additional Comments From roger at eyesopen dot com  2005-02-12 19:31 
-------
Andreas, thanks for the bigger example, I can now reproduce this failure!
I was wondering whether you could try the following patch to see if helps
for you.

Index: tree-eh.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-eh.c,v
retrieving revision 2.24
diff -c -3 -p -r2.24 tree-eh.c
*** tree-eh.c   18 Jan 2005 11:36:24 -0000      2.24
--- tree-eh.c   12 Feb 2005 19:20:44 -0000
*************** tree_could_trap_p (tree expr)
*** 1840,1845 ****
--- 1840,1852 ----
        return true;
        return false;

+     case CALL_EXPR:
+       t = get_callee_fndecl (expr);
+       /* Assume that calls to weak functions may trap.  */
+       if (!t || !DECL_P (t) || DECL_WEAK (t))
+       return true;
+       return false;
+
      default:
        /* Any floating arithmetic may trap.  */
        if (fp_operation && flag_trapping_math)

Basically, this teaches tree_could_trap_p that calls to weak functions may
potentially trap.  This is sufficient to prevent tree-ssa-loop-im.c from
moving the call before the test.  It feels like the right fix.  I'm currently
bootstrapping and regression testing on i686-pc-linux-gnu and ia64-linux.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-02-12 19:31:01
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19917

Reply via email to