On 11/20/2012 02:22 AM, Senthil Kumar Selvaraj wrote: > Hi all, > > For the AVR target, the FP register spans two registers, yet the DWARF > location information (DW_AT_location) for a local variable refers to only > one > of them. > > Looking at the code, I found that based_loc_descr in dwar2out.c, which > handles > base+offset based location descriptions, gets the register number from > the rtx representing the reg and directly proceeds to create > DW_OP_breg0+regno, > without considering the mode. This is unlike reg_loc_descriptor, which > checks hard_regno_nregs[regno][mode] and acts accordingly. > > How are frame pointer registers that span more than one hard register > handled?
I would have to say "poorly", because it simply doesn't happen for any other target. I'm not really sure what advantage you'd have for using a multiple_reg_loc to represent the frame pointer in the DW_AT_location for the frame base. Especially since if you consider Dwarf3 and later should be indicating the frame base via the CFA (DW_OP_call_frame_cfa). > A related question - why does based_loc_descr generate DW_OP_fbreg > only if eliminate_regs eliminates the frame/arg pointer register? I > traced through the execution for my native (x86_64) compiler, and found > that the elimination is actually from the soft frame pointer to the hard > frame > pointer. What if HARD_FRAME_POINTER_REGNUM is the same as > FRAME_POINTER_REGNUM? Shouldn't DW_OP_fbreg be generated for those > targets too? Probably. It would take some digging to figure out why fbreg might not be in use unless elimination succeeded. r~