From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24643 invoked by alias); 11 Dec 2002 14:08:17 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 24612 invoked by uid 61); 11 Dec 2002 14:08:15 -0000 Date: Wed, 11 Dec 2002 06:08:00 -0000 Message-ID: <20021211140815.24611.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, kronoz@tiscali.it, nobody@gcc.gnu.org From: reichelt@igpm.rwth-aachen.de Reply-To: reichelt@igpm.rwth-aachen.de, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, kronoz@tiscali.it, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: optimization/8878: miscompilation with -O and SSE X-SW-Source: 2002-12/txt/msg00628.txt.bz2 List-Id: Synopsis: miscompilation with -O and SSE State-Changed-From-To: open->analyzed State-Changed-By: reichelt State-Changed-When: Wed Dec 11 06:08:13 2002 State-Changed-Why: Confirmed. Here's a cleaned-up testcase (which does not suffer from aliasing problems as the original one, where &c is casted): ----------------------------snip here------------------------- #include typedef int v4sf __attribute__((mode(V4SF))); int main(void) { v4sf v = {1.0, 2.0, 3.0, 4.0}; union { v4sf v; float f[4]; } u; u.v = __builtin_ia32_mulps(v,v); printf("%f %f %f %f\n", u.f[0], u.f[1], u.f[2], u.f[3]); return 0; } ----------------------------snip here------------------------- Compiling this with "gcc -O -msse" on a i686-pc-linux-gnu machine results in an executable that prints 16.000000 0.000000 0.000000 0.000000 instead of 1.000000 4.000000 9.000000 16.000000 as expeceted. Replacing "mulps" by "addps" will generate equally wrong results. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8878