Module Name:    src
Committed By:   snj
Date:           Thu Dec 10 23:47:26 UTC 2015

Modified Files:
        src/external/gpl3/gcc/dist/gcc/config/i386 [netbsd-7-0]: cpuid.h

Log Message:
Pull up following revision(s) (requested by christos in ticket #1048):
        external/gpl3/gcc/dist/gcc/config/i386/cpuid.h: revision 1.2
Fix logic bug where __cpuid gets called when __get_cpuid_max() returns 0.
This happens when __level == 0, from libgcc/config/i386/cpuinfo.c#285.
This breaks early i486 CPUs which don't have cpuid


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.1.1.2.6.1 \
    src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h:1.1.1.2 src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h:1.1.1.2.6.1
--- src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h:1.1.1.2	Sat Mar  1 08:43:18 2014
+++ src/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h	Thu Dec 10 23:47:26 2015
@@ -259,8 +259,9 @@ __get_cpuid (unsigned int __level,
 	     unsigned int *__ecx, unsigned int *__edx)
 {
   unsigned int __ext = __level & 0x80000000;
+  unsigned int __maxlevel = __get_cpuid_max (__ext, 0);
 
-  if (__get_cpuid_max (__ext, 0) < __level)
+  if (__maxlevel == 0 || __maxlevel < __level)
     return 0;
 
   __cpuid (__level, *__eax, *__ebx, *__ecx, *__edx);

Reply via email to