From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17042 invoked by alias); 18 Mar 2013 12:03:50 -0000 Received: (qmail 16961 invoked by uid 48); 18 Mar 2013 12:03:26 -0000 From: "dominik.siatkowski at aldec dot com.pl" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56652] New: Wrong code in O2 - if in inline function Date: Mon, 18 Mar 2013 12:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: dominik.siatkowski at aldec dot com.pl X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-03/txt/msg01332.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56652 Bug #: 56652 Summary: Wrong code in O2 - if in inline function Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: dominik.siatkowski@aldec.com.pl Bug detected with gcc-4.7.2 on i386-linux-gnu Attached example segfalts compiled with -O2 (or even with '-O1 -finline-small-functions -fstrict-overflow -ftree-vrp') Works with -O1. Works also if compiled in one compilation unit. Stepping thru code shows it enters if (count >= 0 && count < size) in shift_right, where count is INT_MIN and size is 2.