https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66853
Bug ID: 66853 Summary: sanitized gcc shows bug in rtlanal.c:4911 shift exponent too large because bitwitdth==0 Product: gcc Version: 5.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zeccav at gmail dot com Target Milestone: --- This appears to be a duplicate for 64327 Sanitized version of gcc 5.1.0 shows a bug in the following /* from gcc file fixopts.c */ /* must be compiled with -O2 */ /*gcc-5.1.0/gcc/rtlanal.c:4911:48: runtime error: shift exponent 4294967295 is too large for 64-bit type 'long unsigned int'*/ /*on source line "return nonzero & ((unsigned HOST_WIDE_INT) 1 << (bitwidth - 1))"*/ /* because unsigned int bitwidth is zero and bitwitdth-1 is 4294967295 on my x86-64 */ /* I did double check with: * bitwidth = GET_MODE_PRECISION (mode); * gcc_assert(bitwidth); */ /* the bug appears compiling fixopts.c crc32.c md5.c and many Fedora 21 kernel files*/ int strcmp(const char *s1, const char *s2); int fixinc_mode; /* must be outside main for bug to appear */ int main (void) { const char *pz; if (strcmp (pz, "true") ) fixinc_mode = 0; }