RFA: document RETURN_ADDR_OFFSET (Was: Re: RFC / RFA: dwarf2 unwinding for targets with call-part-clobbered registers)

Joern Rennecke joern.rennecke@superh.com
Wed Jul 9 12:26:00 GMT 2003


> > And I have some questions on the use of RETURN_ADDR_OFFSET:
> > This macro is not documented.  Is it save to use?  Should we add
> > documentation for it?
> 
> It should be safe to use.  It should be documented.

I've appended a patch to do this.

> > libstdc++-v3/libsupc++/eh_personality.cc:__gxx_personality_v0
> > gets confused by SHmedia addresses, which have the least significant bit
> > set.  
> 
> This is what MASK_RETURN_ADDR is for.

If it is, than it is broken.  The mode bit gets masked out, but isn't put
back in before using the address for returning.  The result is that when I
try to use MASK_RETURN_ADDR for this purpose, the SHmedia handler code gets
executed in SHcompact mode, i.e. 32 bit instructions are interpreted as
pairs of 16 bit instructions, which they are not, and the program crashes.

2003-07-08  J"orn Rennecke <joern.rennecke@superh.com>

	* tm.texi (RETURN_ADDR_OFFSET): Document.

Index: tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.246
diff -p -r1.246 tm.texi
*** tm.texi	5 Jul 2003 00:19:47 -0000	1.246
--- tm.texi	8 Jul 2003 18:47:34 -0000
*************** If you want to support call frame except
*** 2999,3004 ****
--- 2999,3011 ----
  define either this macro or the @code{eh_return} instruction pattern.
  @end defmac
  
+ @defmac 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.
+ @end defmac
+ 
  @defmac ASM_PREFERRED_EH_DATA_FORMAT (@var{code}, @var{global})
  This macro chooses the encoding of pointers embedded in the exception
  handling sections.  If at all possible, this should be defined such



More information about the Gcc mailing list