public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* alpha sjlj exception handling
@ 1997-11-07  2:24 Richard Henderson
  1997-11-07 13:05 ` Jim Wilson
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Henderson @ 1997-11-07  2:24 UTC (permalink / raw)
  To: egcs

So I decided to track down some of the errors we get on Alpha with the
exception bits -- using sjlj still, since it is supposed to be using
the non-local goto support, it ought to work at least a little bit.

And I find that the generated code somehow expects the call-saved
registers to be preserved even though no one seems to save them.

From looking at what anyone is emitting, I would think at a non-local
goto label we would have to assume all registers except for the fp and
sp, which we restored getting back here, are dead. 

Where is this supposed to happen in the regular case of non-local goto?


r~

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

* Re: alpha sjlj exception handling
  1997-11-07  2:24 alpha sjlj exception handling Richard Henderson
@ 1997-11-07 13:05 ` Jim Wilson
  1997-11-08 21:29   ` Jeffrey A Law
       [not found]   ` <12229.879053491.cygnus.egcs@hurl.cygnus.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Jim Wilson @ 1997-11-07 13:05 UTC (permalink / raw)
  To: Richard Henderson; +Cc: egcs

	And I find that the generated code somehow expects the call-saved
	registers to be preserved even though no one seems to save them.

This problem might be related to the recent flow changes.

	Where is this supposed to happen in the regular case of non-local goto?

A function that is the target of a non-local goto will have the global variable
current_function_has_nonlocal_label set.  local-alloc/global/reload all know
that if this variable is set, then pseudos whose lifetime crosses a function
call must be handled specially.  I think this special treatment ends up
generating code in such a way that the call saved register problem goes away.
I am not sure if it is because they are somehow saved/restore though, or
whether they somehow avoid using the registers when they won't be saved and
restored.  The builtin setjmp code does not set this variable.

Another consideration here, there is a bit of special code in reload that
handles the NOTE_INSN_SETJMP that used to be generated by the builtin setjmp
code.  The code looks suspicious to me, but perhaps it was doing something
important that needs to be reimplemented some other way.

Jim

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

* Re: alpha sjlj exception handling
  1997-11-07 13:05 ` Jim Wilson
@ 1997-11-08 21:29   ` Jeffrey A Law
       [not found]   ` <12229.879053491.cygnus.egcs@hurl.cygnus.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Jeffrey A Law @ 1997-11-08 21:29 UTC (permalink / raw)
  To: Jim Wilson; +Cc: Richard Henderson, egcs

  In message < 199711072009.MAA10173@cygnus.com >you write:
  > 	Where is this supposed to happen in the regular case of non-local goto?
  > 
  > A function that is the target of a non-local goto will have the global variable
  > current_function_has_nonlocal_label set.  local-alloc/global/reload all know
  > that if this variable is set, then pseudos whose lifetime crosses a function
  > call must be handled specially.
Correct.

This happens in local-alloc.c:find_free_reg

  /* Don't let a pseudo live in a reg across a function call
     if we might get a nonlocal goto.  */
  if (current_function_has_nonlocal_label
      && qty_n_calls_crossed[qty] > 0)
    return -1;

I assume global & reload have similar checks.


I brought up the question about call clobbered regs and their interaction
with the EH code and Kenner said it "couldn't happen" and he refused to
elaborate why.  Note this was with our old unwinder code, not sjlj exceptions.

I note that we now set current_function_has_nonlocal_label inside some
of our dwarf code for exception handling.  So for normal EH this problem
has been "solved".

However, I doubt it's been fixed for sjlj exceptions; seems to me if you
set current_function_has_nonlocal_label for sjlj exceptions then you should
be OK.

I would think it could be set unconditionally if EH is being used for now --
in the future we might consider turning it off if none of the EH regions
are actually used.


jeff

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

* Re: alpha sjlj exception handling
       [not found]   ` <12229.879053491.cygnus.egcs@hurl.cygnus.com>
@ 1997-11-09 22:20     ` Jason Merrill
  0 siblings, 0 replies; 4+ messages in thread
From: Jason Merrill @ 1997-11-09 22:20 UTC (permalink / raw)
  To: law, egcs

>>>>> Jeffrey A Law <law@cygnus.com> writes:

> I brought up the question about call clobbered regs and their interaction
> with the EH code and Kenner said it "couldn't happen" and he refused to
> elaborate why.

Probably because GNAT doesn't let anything defined ouside of a catch block
and used inside live in a register.

Jason

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

end of thread, other threads:[~1997-11-09 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-07  2:24 alpha sjlj exception handling Richard Henderson
1997-11-07 13:05 ` Jim Wilson
1997-11-08 21:29   ` Jeffrey A Law
     [not found]   ` <12229.879053491.cygnus.egcs@hurl.cygnus.com>
1997-11-09 22:20     ` Jason Merrill

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).