aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-eh.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-eh.c')
-rw-r--r--gcc/tree-eh.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index 20660e4e279..f19c851fb74 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -755,7 +755,7 @@ lower_try_finally_fallthru_label (struct leh_tf_state *tf)
alternative considered below. For the nonce, we always choose the first
option.
- THIS_STATE may be null if if this is a try-cleanup, not a try-finally. */
+ THIS_STATE may be null if this is a try-cleanup, not a try-finally. */
static void
honor_protect_cleanup_actions (struct leh_state *outer_state,
@@ -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)