Generating DWARF CIE info

Michael Eager eager@eagercon.com
Sat Jun 9 13:48:00 GMT 2007


Eric Botcazou wrote:
>> When I looked at what sparc-gcc was generating for the return
>> address column, I discovered that it didn't generate anything.
> 
> At least it generates the RA column:

The CIE says what the RA column is, but there is no initial value
location expression generated for the return address.  That means
that on entry to a function, the CIE cannot be used to tell what
the return address is.

>> Is there any reason to discard it?
> 
> It's supposed to be a constant offset.
> 
>  -- Macro: RETURN_ADDR_OFFSET
>      If defined, an integer-valued C expression for which rtl will be
>      generated to add it to the exception handler address before it is
>      searched in the exception handling tables, and to subtract it
>      again from the address before using it to return to the exception
>      handler.

The macro is INCOMING_RETURN_ADDR_RTX.

INCOMING_RETURN_ADDR_RTX [Macro]
     A C expression whose value is RTL representing the location of the incoming return
     address at the beginning of any function, before the prologue. This RTL is either a
     REG, indicating that the return value is saved in ‘REG’, or a MEM representing a
     location in the stack.

Other than the code which translates RTL to LocExpr not handling REG+offset,
I don't see a reason why REG+OFFSET is not valid, or why the comment says
that it is unnecessary.   On Sparc, it's only unnecessary because Sparc
ignores the CIE.


-- 
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077



More information about the Gcc mailing list