From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18457 invoked by alias); 12 Oct 2013 01:17:54 -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 18414 invoked by uid 48); 12 Oct 2013 01:17:50 -0000 From: "su at cs dot ucdavis.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/58697] New: wrong code (segfaults) at -O3 Date: Sat, 12 Oct 2013 01:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 4.8.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: su at cs dot ucdavis.edu X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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: 2013-10/txt/msg00658.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58697 Bug ID: 58697 Summary: wrong code (segfaults) at -O3 Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu GCC 4.8.1 miscompiles the following code on x86_64-linux at -O3 in 64-bit mode, resulting in a segfault. It doesn't seem to affect the current trunk and 4.7.x. It is related to 58653. $ gcc-4.8 -v Using built-in specs. COLLECT_GCC=gcc-4.8 COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8/libexec/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.8.1/configure --enable-languages=c,c++,objc,obj-c++,fortran,lto --disable-checking --with-gmp=/usr/local/gcc-4.8 --with-mpfr=/usr/local/gcc-4.8 --with-mpc=/usr/local/gcc-4.8 --with-cloog=/usr/local/gcc-4.8 --prefix=/usr/local/gcc-4.8 Thread model: posix gcc version 4.8.1 (GCC) $ $ $ gcc-4.8 -O3 small.c; a.out Segmentation fault (core dumped) $ $ gcc-trunk -O3 small.c; a.out $ $ gcc-4.7 -O3 small.c; a.out $ -------------------------- int b, f, d[5][2]; unsigned int c; int main () { for (c = 0; c < 2; c++) if (d[b + 3][c] & d[b + 4][c]) if (f) break; return 0; }