From 9b396d7ccef4c96f577b6b97ed3604527cfb9181 Mon Sep 17 00:00:00 2001 From: Roger Sayle Date: Thu, 17 Feb 2005 22:32:29 +0000 Subject: re PR tree-optimization/19917 (Weak const function mishandled inside loop) PR tree-optimization/19917 * tree-eh.c (tree_could_trap_p): Consider calls to weak functions to be potentially trapping. From-SVN: r95200 --- gcc/tree-eh.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/tree-eh.c') diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 20660e4..34c5cab 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -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) -- cgit v1.1