diff mbox

PR71017 - libgcc/config/i386/cpuinfo.c:346:17: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Message ID 105CF83D-DD59-411F-8D4B-3166E45FC89A@lps.ens.fr
State New
Headers show

Commit Message

Dominique d'Humières Jan. 7, 2017, 1:14 p.m. UTC
The following patch fixes errors of the kind

libgcc/config/i386/cpuinfo.c:260:17: runtime error: left shift of 1 by 31 places cannot be represented in type ‘int'

2017-01-07  Dominique d'Humieres  <dominiq@lps.ens.fr>

        PR target/71017
        * config/i386/cpuid.h: Fix undefined behavior.


Is it OK for trunk/branches?

TIA

Dominique
diff mbox

Patch

--- ../_clean/gcc/config/i386/cpuid.h	2017-01-01 17:39:04.000000000 +0100
+++ gcc/config/i386/cpuid.h	2017-01-05 15:22:31.000000000 +0100
@@ -91,7 +91,7 @@ 
 #define bit_AVX512CD	(1 << 28)
 #define bit_SHA		(1 << 29)
 #define bit_AVX512BW	(1 << 30)
-#define bit_AVX512VL	(1 << 31)
+#define bit_AVX512VL	(1u << 31)
 
 /* %ecx */
 #define bit_PREFETCHWT1	  (1 << 0)