http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46880
--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2010-12-18 21:33:03
UTC ---
Maybe better set of flags:
$ g++ -O -fgcse -fstack-protector-all -fschedule-insns -fsched-pressure -fweb
pr46880.C
$ ./a.out
Aborted
_Z3foov:
...
xorpd xmm1, xmm1 # tmp65
movsd xmm0, QWORD PTR .LC1[rip] # tmp68,
...
shufpd xmm0, xmm1, 1 # tmp66, tmp65
...
.LC1:
.long 0
.long 1072693248
is wrong, it loads 1.0 to lower 64bits of xmm0, and shufpd can't solve the
situation with given values in xmm0 and xmm1, when xmm0 is output:
it just moves xmm0[0] or xmm0[1] to xmm0[0], and xmm1[0] or xmm1[1] to xmm0[1]
either
xorpd xmm0, xmm0 # tmp65
movsd xmm1, QWORD PTR .LC1[rip] # tmp68,
shufpd xmm0, xmm1, 1 # tmp66, tmp65
or do it the same as with -fno-web:
xorpd xmm0, xmm0 # tmp65
movsd xmm1, QWORD PTR .LC1[rip] # tmp67,
unpcklpd xmm0, xmm1 # tmp65, tmp67