Message ID | 87lhx1fs50.fsf@talisman.default |
---|---|
State | New |
Headers | show |
On Sun, Feb 23, 2014 at 10:14 PM, Richard Sandiford wrote: > I noticed in passing that this 4.7 cleanup: > > http://article.gmane.org/gmane.comp.gcc.patches/224853 ... > so that nothing happens for pseudos. I've no idea whether this makes > a difference in practice or not but it seems safer to restore the old > behaviour. > > Tested on mipsisa64-sde-elf rather than x86_64-linux-gnu since it only > affects reload targets. OK to install? If it's worked since GCC 4.7, why restore that code? I prefer an assert that the reg is not a pseudo. If something would break, it's still possible to restore the old behavior and have an explanation for why it should be like that. Ciao! Steven
Steven Bosscher <stevenb.gcc@gmail.com> writes: > On Sun, Feb 23, 2014 at 10:14 PM, Richard Sandiford wrote: >> I noticed in passing that this 4.7 cleanup: >> >> http://article.gmane.org/gmane.comp.gcc.patches/224853 > ... >> so that nothing happens for pseudos. I've no idea whether this makes >> a difference in practice or not but it seems safer to restore the old >> behaviour. >> >> Tested on mipsisa64-sde-elf rather than x86_64-linux-gnu since it only >> affects reload targets. OK to install? > > If it's worked since GCC 4.7, why restore that code? OK, fair enough. I'll withdraw the patch. Thanks, Richard
Index: gcc/caller-save.c =================================================================== --- gcc/caller-save.c 2014-01-02 22:16:03.383281697 +0000 +++ gcc/caller-save.c 2014-02-23 11:04:27.519785327 +0000 @@ -1339,7 +1339,7 @@ insert_save (struct insn_chain *chain, i static int add_used_regs_1 (rtx *loc, void *data) { - unsigned int regno; + int regno; regset live; rtx x; @@ -1348,10 +1348,10 @@ add_used_regs_1 (rtx *loc, void *data) if (REG_P (x)) { regno = REGNO (x); - if (HARD_REGISTER_NUM_P (regno)) - bitmap_set_range (live, regno, hard_regno_nregs[regno][GET_MODE (x)]); - else + if (!HARD_REGISTER_NUM_P (regno)) regno = reg_renumber[regno]; + if (regno >= 0) + bitmap_set_range (live, regno, hard_regno_nregs[regno][GET_MODE (x)]); } return 0; }