This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/71017] New: libgcc/config/i386/cpuinfo.c:346:17: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 09 May 2016 08:59:03 +0000
- Subject: [Bug target/71017] New: libgcc/config/i386/cpuinfo.c:346:17: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71017
Bug ID: 71017
Summary: libgcc/config/i386/cpuinfo.c:346:17: runtime error:
left shift of 1 by 31 places cannot be represented in
type 'int'
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: dominiq at lps dot ens.fr
Target Milestone: ---
When compiling some tests, e.g. gcc.c-torture/compile/20000511-1.c -O, using
gcc built with -fsanitize=undefined, I get the following error at runtime
libgcc/config/i386/cpuinfo.c:346:17: runtime error: left shift of 1 by 31
places cannot be represented in type 'int'
This is fixed with the following patch
--- ../_clean/gcc/config/i386/cpuid.h 2016-01-04 19:51:13.000000000 +0100
+++ gcc/config/i386/cpuid.h 2016-05-01 12:49:40.000000000 +0200
@@ -90,7 +90,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)