http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50829
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|rtl-optimization |target --- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-11-24 03:43:46 UTC --- The move that is generated in the split should be in the bigger mode. And then apply the following patch: * regrename.c (maybe_mode_change): Return the reg in the new mode if the copy was done in the same mode size. Index: regrename.c =================================================================== --- regrename.c (revision 55954) +++ regrename.c (revision 55955) @@ -1322,6 +1322,15 @@ maybe_mode_change (enum machine_mode ori enum machine_mode new_mode, unsigned int regno, unsigned int copy_regno ATTRIBUTE_UNUSED) { + /* If we are using the register in the copy mode (if the number of hard + registers is the same), just used the reg with the new mode. */ + if (GET_MODE_SIZE (copy_mode) == GET_MODE_SIZE (new_mode) + && hard_regno_nregs[copy_regno][copy_mode] == + hard_regno_nregs[copy_regno][new_mode] + && hard_regno_nregs[regno][copy_mode] == + hard_regno_nregs[copy_regno][new_mode]) + return gen_rtx_raw_REG (new_mode, regno); + if (GET_MODE_SIZE (copy_mode) < GET_MODE_SIZE (orig_mode) && GET_MODE_SIZE (copy_mode) < GET_MODE_SIZE (new_mode)) return NULL_RTX; This will at least remove it with -frename-registers which we most likely should have on by default at -O2 and above now anyways.