https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87763
Wilco <wilco at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wilco at gcc dot gnu.org --- Comment #3 from Wilco <wilco at gcc dot gnu.org> --- (In reply to Segher Boessenkool from comment #2) > The two relevant insns are > > (insn 35 4 40 2 (set (reg:SI 33 v1 [99]) > (reg:SI 0 x0 [ a ])) "87763.c":2:1 46 {*movsi_aarch64} > (nil)) > > (insn 7 10 8 2 (set (reg:SF 33 v1 [orig:95 c ] [95]) > (float:SF (reg:SI 33 v1 [99]))) "87763.c":2:14 921 {floatsisf2} > (nil)) > > (this is the LRA dump; IRA already allocated those registers, LRA didn't > change anything). > > 99 was assigned a floating point register: > Choosing alt 12 in insn 35: (0) w (1) rZ {*movsi_aarch64} > Choosing alt 0 in insn 7: (0) =w (1) w {floatsisf2} > > an integer register would be alt 0 (r<-r), resp. alt 1 (w<-?r). So > apparently > the "?" was costed as more strongly than the cost of the removable register > move, or IRA didn't see that move was unnecessary. > > Confirmed, btw. IRA costing doesn't consider the possibility of a simple move being removeable. Neither does it consider that some variants are more expensive than others - use of '?' is the only way to mark more expensive variants. The example shown is fixed when I change the w=rZ variant to ?w=rZ in movsi_aarch64.