https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87678
Uroš Bizjak <ubizjak at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2018-10-22 CC| |segher at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> --- This is due to combine, which only tries to propagate REG_EQUAL to the user. Consider this slightly simpler test: --cut here-- float foo (float x, float y) { float z = x + y; return z * 2.387f; } --cut here-- gcc -O2 -m32 -fpic -mfpmath=sse -msse: movss .LC0@GOTOFF(%eax), %xmm1 mulss %xmm1, %xmm0 Where combine tries to combine: (insn 8 7 9 2 (set (reg:SF 89) (mem/u/c:SF (plus:SI (reg:SI 82) (const:SI (unspec:SI [ (symbol_ref/u:SI ("*.LC0") [flags 0x2]) ] UNSPEC_GOTOFF))) [0 S4 A32])) "pic.c":5:12 112 {*movsf_internal} (expr_list:REG_DEAD (reg:SI 82) (expr_list:REG_EQUAL (const_double:SF 2.38700008392333984375e+0 [0x0.98c49cp+2]) (nil)))) (insn 9 8 14 2 (set (reg:SF 87) (mult:SF (reg:SF 88 [ z ]) (reg:SF 89))) "pic.c":5:12 815 {*fop_sf_comm} (expr_list:REG_DEAD (reg:SF 89) (expr_list:REG_DEAD (reg:SF 88 [ z ]) (nil)))) Trying 8 -> 9: 8: r89:SF=[r82:SI+const(unspec[`*.LC0'] 1)] REG_DEAD r82:SI REG_EQUAL 2.38700008392333984375e+0 9: r87:SF=r88:SF*r89:SF REG_DEAD r89:SF REG_DEAD r88:SF Failed to match this instruction: (set (reg:SF 87) (mult:SF (reg:SF 88 [ z ]) (const_double:SF 2.38700008392333984375e+0 [0x0.98c49cp+2]))) Combine should retry with the original source insn.