From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7948 invoked by alias); 3 Sep 2015 08:24:57 -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 7910 invoked by uid 48); 3 Sep 2015 08:24:53 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/67442] [5/6 Regression] GCC 5.2.0 on x86_64 creates invalid address on specific array index calculation through pointer Date: Thu, 03 Sep 2015 08:24: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.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status version keywords cf_reconfirmed_on component assigned_to everconfirmed short_desc target_milestone cf_known_to_fail 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-09/txt/msg00230.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67442 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Version|unknown |5.2.0 Keywords| |wrong-code Last reconfirmed| |2015-09-03 Component|target |middle-end Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Ever confirmed|0 |1 Summary|GCC 5.2.0 on x86_64 creates |[5/6 Regression] GCC 5.2.0 |invalid address on specific |on x86_64 creates invalid |array index calculation |address on specific array |through pointer |index calculation through | |pointer Target Milestone|--- |5.3 Known to fail| |5.2.0, 6.0 --- Comment #1 from Richard Biener --- Confirmed on x86_64 and the 5 branch with -O1 even: main: .LFB0: .cfi_startproc movabsq $foo+4294967408, %rax movswl (%rax), %eax ret .original has: short int value = *(bar + (sizetype) (((long unsigned int) i * (long unsigned int) j) * 4294967292 + 16)); works correctly with -fstrict-overflow (or -O2). Some bug in folding somewhere. 4.8 and 4.9 have short int value = *(bar + (sizetype) (((long unsigned int) i * (long unsigned int) j) * 18446744073709551612 + 16));