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

Richard Sandiford <rsandifo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |FIXED

--- Comment #14 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
(In reply to H.J. Lu from comment #13)
> I am using
> 
> /* Return the descriptor of the function ABI type from the command
>    line.  */
> 
> static const predefined_function_abi &
> ix86_command_line_abi (void)
> {
>   auto &command_line_abi = function_abis[ABI_COMMAND_LINE];
>   if (!command_line_abi.initialized_p ())
>     {
>       /* NB: Make a copy of the default function ABI before it is
>          changed by ix86_conditional_register_usage.  */
>       HARD_REG_SET full_reg_clobbers
>         = default_function_abi.full_reg_clobbers ();
>       command_line_abi.initialize (ABI_COMMAND_LINE, full_reg_clobbers);
>     }
>   return command_line_abi;
> }
> 
> to get the command line function ABI.  ix86_command_line_abi is first called
> from
> 
> static void
> ix86_conditional_register_usage (void)
> {
>   int i, c_mask;
> 
>   if (cfun)
>     {
>       /* NB: Call ix86_command_line_abi to make a copy of the default
>          function ABI from the command line before it is changed.  */
>       ix86_command_line_abi ();
> 
> It seems to work.
That seems quite complicated.  Why do you need it?  Normally the default
function ABI is a property of the configuration, not the command line.

Also: the default ABI is (by definition) the ABI that describes which registers
are preserved on exception edges.

I don't know if you've looked at it, but aarch64 already uses function_abi for
preserve_none.  Like x86, aarch64 allows the target to be changed with function
attributes, which has the effect of enabling and disabling registers.  But
aarch64_conditional_register_usage doesn't depend on cfun at all.

Reply via email to