From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18311 invoked by alias); 2 Nov 2012 22:33:11 -0000 Received: (qmail 18234 invoked by uid 48); 2 Nov 2012 22:32:57 -0000 From: "mathias at gaunard dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/55184] New: Invalid codegen with vectors and casts Date: Fri, 02 Nov 2012 22:33: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mathias at gaunard 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: 2012-11/txt/msg00187.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55184 Bug #: 55184 Summary: Invalid codegen with vectors and casts Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target AssignedTo: unassigned@gcc.gnu.org ReportedBy: mathias@gaunard.com Created attachment 28600 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28600 Testcase On x86-64, when 128-bit vectors of long or unsigned long are aliased, an invalid optimization seems to occur and causes only the first element of the vector to be modified. Output is correct when compiled without optimization, but fails with -O1 or greater. Usage of -fno-strict-aliasing doesn't change anything. The problem doesn't seem to appear in the 4.4, 4.5 and 4.7 series. Nevertheless I'd like to know all the cases it affects and whether there is a workaround.