]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
aarch64: Fix narrowing warning in driver-aarch64.cc [PR118603]
authorAndrew Pinski <quic_apinski@quicinc.com>
Sat, 10 May 2025 04:13:48 +0000 (21:13 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Fri, 16 May 2025 14:54:29 +0000 (07:54 -0700)
Since the AARCH64_CORE defines in aarch64-cores.def all use -1 for
the variant, it is just easier to add the cast to unsigned in the usage
in driver-aarch64.cc.

Build and tested on aarch64-linux-gnu.

gcc/ChangeLog:

PR target/118603
* config/aarch64/driver-aarch64.cc (aarch64_cpu_data): Add cast to unsigned
to VARIANT of the define AARCH64_CORE.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/config/aarch64/driver-aarch64.cc

index 9d99554dbc28695865380563b1ab03979d947d67..0333746ee00422e47a8349fad1127a1abface877 100644 (file)
@@ -63,7 +63,7 @@ struct aarch64_core_data
 #define DEFAULT_CPU "generic-armv8-a"
 
 #define AARCH64_CORE(CORE_NAME, CORE_IDENT, SCHED, ARCH, FLAGS, COSTS, IMP, PART, VARIANT) \
-  { CORE_NAME, #ARCH, IMP, PART, VARIANT, feature_deps::cpu_##CORE_IDENT },
+  { CORE_NAME, #ARCH, IMP, PART, unsigned(VARIANT), feature_deps::cpu_##CORE_IDENT },
 
 static CONSTEXPR const aarch64_core_data aarch64_cpu_data[] =
 {