------- Comment #10 from amylaar at gcc dot gnu dot org 2009-03-08 16:35 ------- (In reply to comment #3) > I've checked the old RA. It does not assigned partially clobbered hard > register because it is done only when non partially clobbered hard regs were > tried first. Sh has a lot of such registers therefore the chance to generate > wrong code is small. > > I can simulate the same behaviour for IRA by increasing costs for partially > clobbered hard registers. Currently rs6000 and sh define > HARD_REGNO_CALL_PART_CLOBBERED. So even the problem is solved for sh in > different way, the patch increasing cost would be useful for rs6000. > > Still, as I wrote, the complete solution (the mentioned cost increase will be > still necessary in any case) would be save and restore partially clobbered > hard-registers in caller-saves.c.
To avoid pessimizing code where partially clobbered registers are used to allocate pseudos which are not affected by the partial clobbers, the register allocator will have to provide caller_save.c with more information. It needs to know which registers are live across a call in excess of the part that is saved. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37633