optimization/8878: miscompilation with -O and SSE
Volker Reichelt
reichelt@igpm.rwth-aachen.de
Wed Apr 2 20:14:00 GMT 2003
Hi Janis,
PR 8878 got fixed on mainline in the last couple of days (somewhere
between 2003-03-29 and 2003-04-02).
Since the bug is in the category "wrong-code" it would be nice
if the patch could be backported to 3.3 (and maybe even 3.2) to
prevent silent miscompilations.
Could you please identify the patch that fixed the problem?
Maybe the following testcase is more convenient for the hunt,
since you can check the return value instead of the output:
------------------------snip here----------------------------
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);
return u.f[0];
}
------------------------snip here----------------------------
Just compile with "gcc -march=i686 -msse -O".
Thanks,
Volker
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8878
More information about the Gcc-bugs
mailing list