Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/external/gpl3/gcc/dist/gcc/config/i386 Pull up following ...



details:   https://anonhg.NetBSD.org/src/rev/6ca866b9badb
branches:  netbsd-7
changeset: 799730:6ca866b9badb
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Dec 10 23:48:49 2015 +0000

description:
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

diffstat:

 external/gpl3/gcc/dist/gcc/config/i386/cpuid.h |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r 5729595d4750 -r 6ca866b9badb external/gpl3/gcc/dist/gcc/config/i386/cpuid.h
--- a/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h    Thu Dec 10 23:44:11 2015 +0000
+++ b/external/gpl3/gcc/dist/gcc/config/i386/cpuid.h    Thu Dec 10 23:48:49 2015 +0000
@@ -259,8 +259,9 @@
             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);



Home | Main Index | Thread Index | Old Index