diff options
author | Alexandre Oliva <oliva@adacore.com> | 2023-12-19 21:06:24 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2023-12-19 21:06:24 -0300 |
commit | 181917d56c0cf4b8c1174a492a8157f4a12d1100 (patch) | |
tree | 9e3eff09fb22ea385365dc6e8e5a81795dce8c81 | |
parent | 1b83fce7df32c72bf8e0c766e5ccb285801bce15 (diff) | |
download | gcc-181917d56c0cf4b8c1174a492a8157f4a12d1100.zip gcc-181917d56c0cf4b8c1174a492a8157f4a12d1100.tar.gz gcc-181917d56c0cf4b8c1174a492a8157f4a12d1100.tar.bz2 |
strub: use opt_for_fn during ipa
Instead of global optimization levels and flags, check per-function
ones.
for gcc/ChangeLog
* ipa-strub.cc (gsi_insert_finally_seq_after_call): Likewise.
(pass_ipa_strub::adjust_at_calls_call): Likewise.
-rw-r--r-- | gcc/ipa-strub.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc index 943bb60..32e2869 100644 --- a/gcc/ipa-strub.cc +++ b/gcc/ipa-strub.cc @@ -2132,7 +2132,7 @@ gsi_insert_finally_seq_after_call (gimple_stmt_iterator gsi, gimple_seq seq) || (call && gimple_call_nothrow_p (call)) || (eh_lp <= 0 && (TREE_NOTHROW (cfun->decl) - || !flag_exceptions))); + || !opt_for_fn (cfun->decl, flag_exceptions)))); if (noreturn_p && nothrow_p) return; @@ -2470,9 +2470,11 @@ pass_ipa_strub::adjust_at_calls_call (cgraph_edge *e, int named_args, /* If we're already within a strub context, pass on the incoming watermark pointer, and omit the enter and leave calls around the modified call, as an optimization, or as a means to satisfy a tail-call requirement. */ - tree swmp = ((optimize_size || optimize > 2 + tree swmp = ((opt_for_fn (e->caller->decl, optimize_size) + || opt_for_fn (e->caller->decl, optimize) > 2 || gimple_call_must_tail_p (ocall) - || (optimize == 2 && gimple_call_tail_p (ocall))) + || (opt_for_fn (e->caller->decl, optimize) == 2 + && gimple_call_tail_p (ocall))) ? strub_watermark_parm (e->caller->decl) : NULL_TREE); bool omit_own_watermark = swmp; |