GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/target/aarch64

aarch64: Fix -march=native when -mtune is used

Fixes incorrect CPU feature detection on aarch64 when using -march=native with -mtune.

A bug in the aarch64 target driver has been fixed that affected the handling of -march=native when the -mtune option was also specified. Previously, changes to ARCH_IDENT values caused lookups to fail, leading to incorrect CPU feature detection. This commit adjusts string offsets to ensure proper matching of identifiers, resolving the issue and restoring correct behavior.

In Details

This commit corrects a bug in the aarch64 target driver where the ARCH_IDENT string representation was misaligned due to a prior change. This misalignment caused -march=native to fail when combined with -mtune. The fix ensures that the stringified ARCH_IDENT values correctly map to CPU features, preventing incorrect CPU selection.

For Context
-march=native
A compiler flag that instructs the compiler to detect the host CPU's architecture and enable all its supported instruction set extensions for optimization.
-mtune
A compiler flag that optimizes code for a specific CPU's microarchitecture, without necessarily enabling features beyond those specified by -march.
ARCH_IDENT
Internal identifier used by GCC to represent specific CPU architectures and their features.
Filed Under: aarch64compiler flagsbugfix