From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52003 invoked by alias); 14 Jul 2015 07:36:06 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 51141 invoked by uid 55); 14 Jul 2015 07:36:01 -0000 From: "zeccav at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/64327] ../../gcc/gcc/rtlanal.c:4881:48: runtime error: shift exponent 4294967295 is too large for 64-bit type 'long unsigned int' Date: Tue, 14 Jul 2015 07:36:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zeccav at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg01094.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64327 --- Comment #4 from Vittorio Zecca --- For your convenience I repeat here the reproducer: /* 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*/ /* 66853 duplicato di 64327 */ 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; }