From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1613 invoked by alias); 20 Jan 2015 13:32:14 -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 1579 invoked by uid 48); 20 Jan 2015 13:32:09 -0000 From: "philipp.gschwandtner at uibk dot ac.at" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/64689] New: tree-vectorize generates wrong code with inlined function - minimum working example included Date: Tue, 20 Jan 2015 13:32: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.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: philipp.gschwandtner at uibk dot ac.at 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 attachments.created 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: 2015-01/txt/msg02041.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64689 Bug ID: 64689 Summary: tree-vectorize generates wrong code with inlined function - minimum working example included Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: philipp.gschwandtner at uibk dot ac.at Created attachment 34500 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34500&action=edit minimum working example The tree vectorizer in gcc 4.7-4.9 appears to generate semantically incorrect code for the particular case clarified in the attached minimum working example. gcc 4.6.3 does not show this issue. In gcc 4.7.3 only one of the checks fails, in gcc 4.8.3 and 4.9.2 both of them fail (as these versions also seem to recognize case A as vectorizable). Testing was performed on an Intel Xeon E5-2699 v3 Haswell CPU running a 3.10.0-123.13.1.el7.x86_64 Linux kernel. Compile with: gcc test.c -o test -O3 -std=c99 -pedantic -Wall -Wextra -fwrapv -fno-strict-aliasing Expected output (equals gcc 4.6.3 output): Checking case A: EQUAL! Checking case B: EQUAL! Actual output (for gcc 4.8.3 and 4.9.2): Checking case A: NOT EQUAL! C1: -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, C2: -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, Checking case B: NOT EQUAL! C1: -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, -2 0i, C2: -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, -1 0i, Above output is produced when compiled with gcc 4.9.2 and 4.8.3. For gcc 4.7.3 the check for case A succeeds while the check for case B still fails.