On Sat, Jan 27, 2024 at 05:52:34AM -0800, H.J. Lu wrote:
> @@ -3391,7 +3392,9 @@ ix86_set_func_type (tree fndecl)
>       function is marked as noreturn in the IR output, which leads the
>       incompatible attribute error in LTO1.  */
>    bool has_no_callee_saved_registers
> -    = (((TREE_NOTHROW (fndecl) || !flag_exceptions)
> +    = ((optimize
> +     && !optimize_debug

Shouldn't that be opt_for_fn (fndecl, optimize) and ditto for
optimize_debug?
I mean, aren't the options not restored yet when this function is called
(i.e. remain in whatever state they were in the previous function or
global state)?

Also, shouldn't the lookup_attribute ("noreturn" check be the first one?
I mean, noreturn functions are quite rare and so checking all the other
conditions upon each set_cfun could waste too much compile time.

Also, why check "noreturn" attribute rather than
TREE_THIS_VOLATILE (fndecl)?

        Jakub

Reply via email to