optimization/8878: miscompilation with -O and SSE
Janis Johnson
janis187@us.ibm.com
Wed Apr 2 20:14:00 GMT 2003
On Wed, Apr 02, 2003 at 09:17:49PM +0200, Volker Reichelt wrote:
> 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".
I don't know much about x86 architectures and what's
supposed to work where, but on my Pentium III this gets
"Illegal instruction" when run, using a mainline compiler
from sources updated yesterday.
Janis
More information about the Gcc-bugs
mailing list