1 May 2003 22:14
Re: new register allocator and HARD_REGNO_CALL_PART_CLOBBERED
Daniel Berlin <dberlin <at> dberlin.org>
2003-05-01 20:14:43 GMT
2003-05-01 20:14:43 GMT
On Thursday, May 1, 2003, at 03:21 PM, Herman ten Brugge wrote: > Dale Johannesen wrote : >> >> On Wednesday, April 30, 2003, at 12:31 PM, Herman ten Brugge wrote: >> >>> Hello, >>> >>> I found a problem with the -fnew-ra option of the compiler. I >>> analysed >>> the problem and found that the macro HARD_REGNO_CALL_PART_CLOBBERED >>> is not used by the new register allocator. >>> I think this is also a bit difficult to implement because we now >>> have to check the mode for every register that is used during a >>> CALL_INSN. >> >> You can try the following (mail may have screwed up spacing). It may >> result in even worse code than your patch, but maybe it's better than >> trying to work around this new-ra problem in individual targets. >> (Untested, I do not have a c4x.) > > I do not think the problem is in df.c. It is. > The code in df.c walks through the > rtl and sets clobbered/used register info. Right, and HARD_REGNO_CALL_PART_CLOBBERED says that hard regs are clobbered. Notice that the portion of the code modified in df.c is dealing with hard registers that are killed by calls. > We do not yet know what mode > the hard registers will get (reg_raw_mode can not be used here). The > mode > is assigned in the new-ra pass. This has nothnig to do with anything. > We run df.c when no hard registers are set yet, only pseudo registers > are set. This is wrong. The code in question in df.c is determining what regs are killed by calls. This is *exactly* the right place to do it. > HARD_REGNO_CALL_PART_CLOBBERED works only on hard registers, > so how should this work? See how HARD_REGNO_CALL_PART_CLOBBERED is > used in local_alloc.c and global.c. Because they don't use df.c for register info, like new-ra does.
RSS Feed