> On 24 Apr 2025, at 14:28, Jakub Jelinek <ja...@redhat.com> wrote: > > On Thu, Apr 24, 2025 at 12:05:06PM +0000, Kyrylo Tkachov wrote: >>>>> On 24 Apr 2025, at 12:09, Jakub Jelinek <ja...@redhat.com> wrote: >>>>> >>>>> On Thu, Apr 24, 2025 at 09:54:09AM +0000, Kyrylo Tkachov wrote: >>>>>>> I'd have expected instead of the LTO_PARTITION_DEFAULT checks one >>>>>>> should be >>>>>>> testing !opts_set->x_flag_lto_partition (i.e. -flto-partition=balanced >>>>>>> should be the default, but when not specified explicitly, it would >>>>>>> really >>>>>>> match that >>>>>>> error ("%<-fipa-reorder-for-locality%> is incompatible with" >>>>>>> >>>>>>> >>>>>>> " an explicit %qs option", "-flto-partition"); >>>>>>> >>>>>>> >>>>>>> error wording (right now -fipa-reorder-for-locality >>>>>>> -flto-partition=default >>>>>>> is explicit, yet no error is emittetd). >>>>>> >>>>>> Yes, I think I was confused about the use of opts_set. This is overly >>>>>> convoluted. >>>>>> So something like this? >>>>> >>>>> Yes, though I'd also remove the trailing comma after >>>>> LTO_PARTITION_CACHE = 5 >>>> >>>> Right, ok to commit this to trunk and GCC 15 branch once bootstrap is >>>> successful? >>> >>> Yes. >> >> Thanks, I’ve now pushed the fix to trunk and the branch. > > Actually, sorry, I'm afraid the x_flag_ipa_reorder_for_locality case should > be using opts and not opts_set. > > Because right now I see > $ ./xgcc -B ./ -o abc abc.c -flto-partition=balanced > -fipa-reorder-for-locality > cc1: error: ‘-fipa-reorder-for-locality’ is incompatible with an explicit > ‘-flto-partition’ option > $ ./xgcc -B ./ -o abc abc.c -fipa-reorder-for-locality > $ ./xgcc -B ./ -o abc abc.c -flto-partition=balanced > -fno-ipa-reorder-for-locality > cc1: error: ‘-fipa-reorder-for-locality’ is incompatible with an explicit > ‘-flto-partition’ option > $ ./xgcc -B ./ -o abc abc.c -fno-ipa-reorder-for-locality > $ ./xgcc -B ./ -o abc abc.c -flto-partition=balanced > $ ./xgcc -B ./ -o abc abc.c > > The third case looks undesirable, -fno-ipa-reorder-for-locality is the > default and shouldn't affect anything, whether explicit or implicit.
I see. With this patch I don’t get a complaint on -flto-partition=balanced -fno-ipa-reorder-for-locality while still getting the error for -fipa-reorder-for-locality with any -flto-partition= value. Thanks, Kyrill > > Jakub >
0001-opts.cc-Use-opts-rather-than-opts_set-for-validating.patch
Description: 0001-opts.cc-Use-opts-rather-than-opts_set-for-validating.patch