[Bug target/124629] [aarch64] -march=native is ignored when -mtune is used

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124629

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Alice Carlotti
<[email protected]>:

https://gcc.gnu.org/g:38ac911b5f1c7d81f375cb4253336ed1c713967f

commit r13-10471-g38ac911b5f1c7d81f375cb4253336ed1c713967f
Author: Alice Carlotti <[email protected]>
Date:   Fri Aug 7 17:56:49 2026 +0100

    aarch64: Fix -march=native when -mtune is used [PR124629]

    Handling of -march=native for recognised cores was broken by
    r13-2937-g00c22ba69d8e73, which added "V" to ARCH_IDENT values and
    filtered it out in some locations.  This causes a lookup by stringified
    ARCH_IDENT values to fail.  If no -mtune or -mcpu option is used, then
    we avoid this bug by upgrading -march=native to -mcpu=native.

    Fix this by removing the '+ 1' string offset, so that the ident strings
    match again.  It would be marginally more efficient to use enum values
    here, but I've stuck with this simpler fix instead.

    gcc/ChangeLog:

            PR target/124629
            * config/aarch64/driver-aarch64.cc (AARCH64_ARCH):
            Don't skip first character of #ARCH_IDENT.

    gcc/testsuite/ChangeLog:

            PR target/124629
            * gcc.target/aarch64/cpunative/info_36: New test file.
            * gcc.target/aarch64/cpunative/native_cpu_36.c: New test.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.