On Thu, Apr 24, 2025 at 09:10:37AM +0000, Kyrylo Tkachov wrote:
> [resending to the list, I think there might have been an error with the 
> previous message]
> 
> Hi all,
> 
> This is a thinko in the logic for handling the default -flto-partition=
> arguments. We should override it to balanced only if it stayed as default
> up to that point. We should also be testing opts instead of opts_set here.
> 
> Bootstrapped and tested on aarch64-none-linux-gnu.
> 
> Ok for trunk? Sorry for the late patch, but I guess we want this in the GCC 
> 15 branch as well.
> Thanks,
> Kyrill
> 
> Signed-off-by: Kyrylo Tkachov <ktkac...@nvidia.com>
> 
> gcc/
> 
>       * opts.cc (finish_options): Check for == against LTO_PARTITION_DEFAULT
>       before setting LTO_PARTITION_BALANCED.

I think
     opts_set->x_flag_lto_partition = opts->x_flag_lto_partition = 
LTO_PARTITION_BALANCED;                                                         
                                   
is also wrong.
opts_set should have bool in whatever type the field has, so I think it
should be
    {
      opts->x_flag_lto_partition = LTO_PARTITION_BALANCED;
      opts_set->x_flag_lto_partition = true;
    }
(or maybe just opts->x_flag_lto_partition = LTO_PARTITION_BALANCED; alone?).
LTO_PARTITION_BALANCED is 2...

        Jakub

Reply via email to