[(pushed)] x86: fix VENDOR_MAX enum value

Message ID fcd09944-8210-be23-dc1b-5a435f8eae26@suse.cz
State Committed
Commit f751bf4c5d1aaa1aacfcbdec62881c5ea1175dfb
Headers
Series [(pushed)] x86: fix VENDOR_MAX enum value |

Commit Message

Martin Liška Oct. 24, 2022, 6:24 p.m. UTC
  Hi.

The following patch fixes detection of VENDOR_CENTAUR CPU vendors when -march=native is used.
Problem what that BUILTIN_VENDOR_MAX dropped the current enum value to VENDOR_OTHER (4)
and thus VENDOR_MAX was 5 and not 7.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.
I'm going to push it as obvious.

            PR target/107364
    
    gcc/ChangeLog:
    
            * common/config/i386/i386-cpuinfo.h (enum processor_vendor):
              Reorder enum values as BUILTIN_VENDOR_MAX should not point
              in the middle of the valid enum values.

Martin

---
 gcc/common/config/i386/i386-cpuinfo.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gcc/common/config/i386/i386-cpuinfo.h b/gcc/common/config/i386/i386-cpuinfo.h
index 9893fc422bc..586a1a2d0f6 100644
--- a/gcc/common/config/i386/i386-cpuinfo.h
+++ b/gcc/common/config/i386/i386-cpuinfo.h
@@ -34,8 +34,10 @@  enum processor_vendor
   VENDOR_CENTAUR,
   VENDOR_CYRIX,
   VENDOR_NSC,
+
+  /* Maximum values must be at the end of this enum.  */
+  VENDOR_MAX,
   BUILTIN_VENDOR_MAX = VENDOR_OTHER,
-  VENDOR_MAX
 };
 
 /* Any new types or subtypes have to be inserted at the end. */