[Bug libgcc/77273] New: 1 << 31 is undefined in gcc/config/i386/cpuid.h:93
zeccav at gmail dot com
gcc-bugzilla@gcc.gnu.org
Tue Aug 16 18:17:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77273
Bug ID: 77273
Summary: 1 << 31 is undefined in gcc/config/i386/cpuid.h:93
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: libgcc
Assignee: unassigned at gcc dot gnu.org
Reporter: zeccav at gmail dot com
Target Milestone: ---
While compiling gcc itself, the sanitizer complains as follows:
gcc-trunk-239276/libgcc/config/i386/cpuinfo.c:346:17: runtime error: left shift
of 1 by 31 places cannot be represented in type 'int'
cpuinfo.c:346 is "if (ebx & bit_AVX512VL)"
bit_AVX512VL is defined in cpuid.h:249 as
#define bit_AVX512VL (1 << 31)
I believe 1 << 31 is undefined, because "1" is int,
it should be 1u << 31 or 1U << 31
cpuid.h:66 is "#define bit_3DNOW (1 << 31)" by the way
More information about the Gcc-bugs
mailing list