From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3503 invoked by alias); 16 Jan 2013 00:27:47 -0000 Received: (qmail 3334 invoked by uid 48); 16 Jan 2013 00:27:23 -0000 From: "nfxjfg at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/55999] New: gcc 4.7.2 -O2 -floop-parallelize-all generates incorrect code Date: Wed, 16 Jan 2013 00:27: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: normal X-Bugzilla-Who: nfxjfg at gmail dot com 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-01/txt/msg01447.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55999 Bug #: 55999 Summary: gcc 4.7.2 -O2 -floop-parallelize-all generates incorrect code Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: nfxjfg@gmail.com struct s { int8_t num, c; int8_t xs[4], ys[4]; }; void stuff(struct s *desc) { int n; for (n = 0; n < desc->num; n++) { desc->xs[n] = (n == 1 || n == 2) ? desc->c : 0; desc->ys[n] = (n == 1 || n == 2) ? desc->c : 0; } } desc->xs[0] is not 0 after calling this function, although it should be. The attached log was generated with gcc -v -save-temps gcc_issue.c gcc_issue_main.c -Wall -Wextra -O2 -floop-parallelize-all > log.txt 2>&1 The assert in gcc_issue_main.c should not be triggered (and is not triggered when removing -O2 or -floop-parallelize-all).