aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <ktkachov@nvidia.com>2025-04-24 05:33:54 -0700
committerKyrylo Tkachov <ktkachov@nvidia.com>2025-04-24 14:43:09 +0200
commitfbf8443961f484ed7fb7e953206af1ee60558a24 (patch)
treeea2e49171e839216b9f1b1d178ccf975cc479369 /gcc
parent515d9be7944e89f5ec4363f9816ad4031ab6394b (diff)
downloadgcc-fbf8443961f484ed7fb7e953206af1ee60558a24.zip
gcc-fbf8443961f484ed7fb7e953206af1ee60558a24.tar.gz
gcc-fbf8443961f484ed7fb7e953206af1ee60558a24.tar.bz2
opts.cc: Use opts rather than opts_set for validating -fipa-reorder-for-locality
This ensures -fno-ipa-reorder-for-locality doesn't complain with an explicit -flto-partition=. Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com> * opts.cc (validate_ipa_reorder_locality_lto_partition): Check opts instead of opts_set for x_flag_ipa_reorder_for_locality. (finish_options): Update call site.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/opts.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/opts.cc b/gcc/opts.cc
index 5480b9d..ffcbdfe 100644
--- a/gcc/opts.cc
+++ b/gcc/opts.cc
@@ -1037,18 +1037,19 @@ report_conflicting_sanitizer_options (struct gcc_options *opts, location_t loc,
}
}
-/* Validate from OPTS_SET that when -fipa-reorder-for-locality is
+/* Validate from OPTS and OPTS_SET that when -fipa-reorder-for-locality is
enabled no explicit -flto-partition is also passed as the locality cloning
pass uses its own partitioning scheme. */
static void
-validate_ipa_reorder_locality_lto_partition (struct gcc_options *opts_set)
+validate_ipa_reorder_locality_lto_partition (struct gcc_options *opts,
+ struct gcc_options *opts_set)
{
static bool validated_p = false;
if (opts_set->x_flag_lto_partition)
{
- if (opts_set->x_flag_ipa_reorder_for_locality && !validated_p)
+ if (opts->x_flag_ipa_reorder_for_locality && !validated_p)
error ("%<-fipa-reorder-for-locality%> is incompatible with"
" an explicit %qs option", "-flto-partition");
}
@@ -1267,7 +1268,7 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
if (opts->x_flag_reorder_blocks_and_partition)
SET_OPTION_IF_UNSET (opts, opts_set, flag_reorder_functions, 1);
- validate_ipa_reorder_locality_lto_partition (opts_set);
+ validate_ipa_reorder_locality_lto_partition (opts, opts_set);
/* The -gsplit-dwarf option requires -ggnu-pubnames. */
if (opts->x_dwarf_split_debug_info)