re PR tree-optimization/19917 (Weak const function mishandled inside loop)
authorRoger Sayle <roger@eyesopen.com>
Thu, 17 Feb 2005 22:32:29 +0000 (22:32 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Thu, 17 Feb 2005 22:32:29 +0000 (22:32 +0000)
PR tree-optimization/19917
* tree-eh.c (tree_could_trap_p): Consider calls to weak functions
to be potentially trapping.

From-SVN: r95200

gcc/ChangeLog
gcc/tree-eh.c

index a85b50972b323e5cfa80de783a1ba1fc56435f87..0fb1e729c8910ba0e77deed26ec468cfabeffcee 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-17  Roger Sayle  <roger@eyesopen.com>
+
+       PR tree-optimization/19917
+       * tree-eh.c (tree_could_trap_p): Consider calls to weak functions
+       to be potentially trapping.
+
 2005-02-17  Kazu Hirata  <kazu@cs.umass.edu>
 
        * libgcc2.c, tree-vect-analyze.c: Fix comment typos.
index 20660e4e279022865c47c48cd9be6a2935844ea7..34c5cab921cc53bc700262d139a6290ac5f5903a 100644 (file)
@@ -1840,6 +1840,13 @@ tree_could_trap_p (tree expr)
        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)