From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 48643 invoked by alias); 16 Apr 2015 19:49:12 -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 48558 invoked by uid 48); 16 Apr 2015 19:49:08 -0000 From: "wschmidt at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/65787] New: [5.1 regression] Miscompile due to bad vector swap optimization for little endian Date: Thu, 16 Apr 2015 19:49:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 5.1.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: wschmidt at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: wschmidt at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc cf_gcchost cf_gcctarget cf_gccbuild 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-04/txt/msg01380.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65787 Bug ID: 65787 Summary: [5.1 regression] Miscompile due to bad vector swap optimization for little endian Product: gcc Version: 5.1.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: target Assignee: wschmidt at gcc dot gnu.org Reporter: wschmidt at gcc dot gnu.org CC: bergner at gcc dot gnu.org, dje.gcc at gmail dot com, jakub at gcc dot gnu.org, rguenth at gcc dot gnu.org Host: powerpc64le-linux-gnu Target: powerpc64le-linux-gnu Build: powerpc64le-linux-gnu Created attachment 35337 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35337&action=edit Preprocessed source GCC 5.1 miscompiles the attached file. The POWER-specific vector swap optimization doesn't recognize a vector extract pattern because it's hidden inside a parallel with a clobber. As a result it doesn't adjust the lane to be extracted. I'm working on a patch to detect this case and fix it up. This is probably miscompiled by the latest 4.8 and 4.9 base code as well, since the swap optimization was backported recently. I have not yet verified this, though. It could be that this pattern is not created for those releases.