https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105459

--- Comment #11 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #9)
> inline_call will force reload global optimization.
> 
>   /* Reload global optimization flags.  */
>   if (reload_optimization_node && DECL_STRUCT_FUNCTION (to->decl) == cfun)
>     set_cfun (cfun, true);
> 
> It looks that ix86_set_current_function can create one new target option
> node even if fndecl == ix86_previous_fndecl but
> flag_unsafe_math_optimizations (or flag_excess_precision) != the
> corresponding values in the associated target node.

We can't do this during the target hook ix86_set_current_function since at that
time (WPA phase) the cfun is NULL, even if we want to update the target option
node for to->decl, but the passed down fndecl is NULL.

I made a patch to rebuild the target option node for to->decl DECL once
reload_optimization_node is true. For this failure case, the
opts.x_flag_unsafe_math_optimizations has changed, we have to sync it to
x_ix86_unsafe_math_optimizations and rebuild.

Reply via email to