https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113280
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> So the problem seems like combine decides somehow to
> combine:
> ```
> (insn 7 4 9 2 (set (reg/v:SF 100 [ xD.4459 ])
> (plus:SF (reg/v:SF 102 [ aD.4455 ])
> (reg/v:SF 103 [ bD.4456 ]))) "/app/example.cpp":6:7 1043 {addsf3}
> (expr_list:REG_DEAD (reg/v:SF 102 [ aD.4455 ])
> (nil)))
> (insn 9 7 10 2 (set (reg:SF 104 [ xD.4459 ])
> (asm_operands:SF ("") ("=X") 0 [
> (reg/v:SF 100 [ xD.4459 ])
> ]
> [
> (asm_input:SF ("0") /app/example.cpp:8)
> ]
> [] /app/example.cpp:8)) "/app/example.cpp":8:5 -1
> (expr_list:REG_DEAD (reg/v:SF 100 [ xD.4459 ])
> (nil)))
> into:
> ```
> (insn 9 7 10 2 (set (reg:SF 104 [ xD.4459 ])
> (asm_operands:SF ("") ("=X") 0 [
> (plus:SF (reg:SF 106)
> (reg/v:SF 103 [ bD.4456 ]))
> ]
> [
> (asm_input:SF ("0") /app/example.cpp:8)
> ]
> [] /app/example.cpp:8)) "/app/example.cpp":8:5 -1
> (expr_list:REG_DEAD (reg:SF 106)
> (nil)))
> ```
>
> But the dump from combine does not make sense:
> ```
> Trying 7 -> 9:
> 7: r100:SF=r106:SF+r103:SF
> REG_DEAD r106:SF
> 9: r104:SF=asm_operands
> REG_DEAD r100:SF
> Failed to match this instruction:
> (set (reg:SF 104 [ xD.4459 ])
> (asm_operands:SF ("") ("=X") 0 [
> (plus:SF (reg:SF 106)
> (reg/v:SF 103 [ bD.4456 ]))
> ]
> [
> (asm_input:SF ("0") /app/example.cpp:8)
> ]
> [] /app/example.cpp:8))
> allowing combination of insns 7 and 9
> original costs 8 + 4 = 12
> replacement cost 4
> deferring deletion of insn with uid = 7.
> modifying insn i3 9: r104:SF=asm_operands
> REG_DEAD r106:SF
> deferring rescan insn with uid = 9.
> ```
So basically check_asm_operands accepts the insn because the plus matches the
operand but this is an output operand which does not work as it is not an
lvalue ...