public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: exception_receiver in i386.md
@ 2001-01-18 15:51 John Wehle
  2001-01-19  3:35 ` Philip Blundell
  0 siblings, 1 reply; 4+ messages in thread
From: John Wehle @ 2001-01-18 15:51 UTC (permalink / raw)
  To: pb; +Cc: gcc, rth

> Mon Jun 22 23:13:47 1998  John Wehle  (john@feith.com)
> 
> 	* i386.md (exception_receiver): Define.
> 
> John, do you remember why this was done?

md.texi says:

  @cindex @code{exception_receiver} instruction pattern
  @item @samp{exception_receiver}
  This pattern, if defined, contains code needed at the site of an
  exception handler that isn't needed at the site of a nonlocal goto.  You
  will not normally need to define this pattern.  A typical reason why you
  might need this pattern is if some value, such as a pointer to a global
  table, must be restored after control flow is branched to the handler of
  an exception.  There are no arguments.

The PIC register is a pointer to a global table which may need to be
restored.  Is there some other mechanism which guarantees that the
PIC register contains the proper value (i.e. what about a shared
library throwing an exception caught by another shared library)?

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: exception_receiver in i386.md
  2001-01-18 15:51 exception_receiver in i386.md John Wehle
@ 2001-01-19  3:35 ` Philip Blundell
  0 siblings, 0 replies; 4+ messages in thread
From: Philip Blundell @ 2001-01-19  3:35 UTC (permalink / raw)
  To: John Wehle; +Cc: gcc, rth

In message < 200101182351.SAA23905@jwlab.FEITH.COM >, John Wehle writes:
>restored.  Is there some other mechanism which guarantees that the
>PIC register contains the proper value (i.e. what about a shared
>library throwing an exception caught by another shared library)?

Apparently the dwarf2 unwinder is supposed to restore call-saved 
registers (which the PIC register is on i386) automatically.  Did you 
actually observe that the PIC register was getting corrupted without this 
exception_receiver?

See < http://gcc.gnu.org/ml/gcc-patches/2001-01/msg01174.html > and the 
associated thread for some discussion.

p.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: exception_receiver in i386.md
@ 2001-01-23 15:38 John Wehle
  0 siblings, 0 replies; 4+ messages in thread
From: John Wehle @ 2001-01-23 15:38 UTC (permalink / raw)
  To: pb; +Cc: gcc, rth

> Did you actually observe that the PIC register was getting corrupted
> without this exception_receiver?

No.  I was going strictly on the documentation in md.texi and discussions
with Jeffrey Law and Jason Merrill.

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* exception_receiver in i386.md
@ 2001-01-15  2:42 Philip Blundell
  0 siblings, 0 replies; 4+ messages in thread
From: Philip Blundell @ 2001-01-15  2:42 UTC (permalink / raw)
  To: Richard Henderson, john; +Cc: gcc

Richard Henderson wrote:
>On Sun, Jan 14, 2001 at 11:09:34PM +0000, Philip Blundell wrote:
>> Fair enough.  I noticed that i386 has an exception_receiver like that;
>> is that needed for some other reason?

>Hmm.  It would be worth while to do some archaeology and find out why
>it was added.  I suspect that it was supersticious.  Someone saw that
>such a pattern was added to another port that has a call-clobbered pic
>register and figured the same thing was needed for x86.

Turns out it's been there since 1998 - longer, in fact, than the 
builtin_setjmp_receiver, which was only added in January 2000.

Mon Jun 22 23:13:47 1998  John Wehle  (john@feith.com)

	* i386/freebsd-elf.h (JUMP_TABLES_IN_TEXT_SECTION): Define as flag_pic.
	* i386/sysv4.h (JUMP_TABLES_IN_TEXT_SECTION): Define as flag_pic.

	* i386.md (exception_receiver): Define.

John, do you remember why this was done?

p.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-01-23 15:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-18 15:51 exception_receiver in i386.md John Wehle
2001-01-19  3:35 ` Philip Blundell
  -- strict thread matches above, loose matches on Subject: below --
2001-01-23 15:38 John Wehle
2001-01-15  2:42 Philip Blundell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).