https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126697

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <[email protected]>:

https://gcc.gnu.org/g:d0aa6740323e48d4b3743dc8fcd5c0ff552f86d1

commit r17-3274-gd0aa6740323e48d4b3743dc8fcd5c0ff552f86d1
Author: H.J. Lu <[email protected]>
Date:   Fri Aug 7 16:21:54 2026 +0800

    x86: Update cpuid.h to pass leaf to __get_cpuid_max

    commit 44cc8e5718efd0cc1ef57c68052dbe33b047f158
    Author: Ewan <[email protected]>
    Date:   Tue Mar 17 16:12:15 2026 +0800

        i386: Fix __get_cpuid() and __get_cpuid_count() for Centaur/Zhaoxin
CPUID ra
    nge

    caused many regressions, like

    FAIL: gcc.dg/vect/vect-100.c scan-tree-dump-not optimized "Invalid sum"

    on Linux/x86-64 with -m32.  The commit above changed __get_cpuid_count
    which is used by check_vect in tree-vect.h.  When GCC tried to vectorize
    check_vect, it outputted

    __attribute__((noinline))
    void check_vect ()
    {
    ...
    ;;   Invalid sum of incoming counts 966367640 (estimated locally, freq
0.9000),
    should be 719407024 (estimated locally, freq 0.6700)

    which failed

    /* { dg-final { scan-tree-dump-not "Invalid sum" "optimized" } } */

    Change __get_cpuid and __get_cpuid_count to pass the leaf argument
    directly to __get_cpuid_max and apply 0xC0000000 mask before passing
    it to CPUID.

            PR testsuite/126697
            * config/i386/cpuid.h (__get_cpuid_max): Rename the first
            argument to __leaf and apply 0xC0000000 mask before passing
            it to CPUID.
            (__get_cpuid): Pass __leaf to __get_cpuid_max.
            (__get_cpuid_count): Likewise.

    Signed-off-by: H.J. Lu <[email protected]>

Reply via email to