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? Would it be appropriate to check the mode and do a multiple_reg_loc_descriptor call or something similar to handle this case? 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? Regards Senthil