From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13244 invoked by alias); 4 Jan 2013 12:24:36 -0000 Received: (qmail 13164 invoked by uid 48); 4 Jan 2013 12:24:12 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/55875] [4.8 Regression] IVopts caused miscompilation Date: Fri, 04 Jan 2013 12:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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-01/txt/msg00306.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55875 --- Comment #2 from Jakub Jelinek 2013-01-04 12:24:12 UTC --- ssa name _12 type long unsigned int base 4294967295 step 1 ssa name _13 type long unsigned int base 34359738360 step 8 ssa name _14 type const struct A * base a_4 + 34359738360 step 8 base object (void *) a_4 all look wrong to me, it ignores the wrapping in the narrower type. OT, I wonder why number of iterations analysis doesn't figure out smaller number: Analyzing # of iterations of loop 1 exit condition [1, + , 1] < (unsigned int) n_5 bounds on difference of bases: 0 ... 4294967294 result: # of iterations (unsigned int) n_5 + 4294967295, bounded by 4294967294 The loop condition is: i_18 = i_21 + 1; if (i_18 < _20) and _20 is: _20 = (unsigned int) n_5; where short unsigned int n; thus, I'd thought we should figure out from that that i_18 will be at most 0xffff (highest possible n_5 is 0xffff). But that is 4.9 material likely, while the ivopts? bug is a severe 4.8 issue.