------- Additional Comments From uros at gcc dot gnu dot org 2004-12-01 14:07 ------- With "GCC: (GNU) 4.0.0 20041201 (experimental)", following code is produced (without -ffast-math):
_Z6foobarv: .LFB2: pushl %ebp .LCFI0: movl %esp, %ebp .LCFI1: subl $4, %esp .LCFI2: flds b+12 fmuls a+12 movss b, %xmm1 mulss a, %xmm1 addss .LC0, %xmm1 movss b+4, %xmm0 mulss a+4, %xmm0 addss %xmm0, %xmm1 movss b+8, %xmm0 mulss a+8, %xmm0 addss %xmm0, %xmm1 movss %xmm1, -4(%ebp) flds -4(%ebp) faddp %st, %st(1) leave ret Please note, that we should return the result in fp reg, so final flds is needed in any case. I think, this code is optimal. Should we close this bug? Uros. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17619