This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ia64 unwind thoughts


>>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:

> On Fri, Feb 23, 2001 at 07:06:41PM +0000, Jason Merrill wrote:
>> If there are no cleanups, we should give a null landing pad offset as well,
>> since we don't need to return to the function.

> So (@Start == @LPStart && LPad == 0) means keep unwinding?
> How abort when @Start != @LPStart?  How can a null landing
> pad be represented there?

> One could say that LPad must always have a non-zero value,

That's what I was thinking.

> but I bet that's not what HP had in mind.

The HP document doesn't seem to have considered calls that don't need a
landing pad...it would be nice to know how they've actually implemented
this stuff.  Hopefully that will be clear from the code they release.

> Not that it matters that much, given the other tweeks we'll be making.

Nope.  And we don't really have to worry about LSDA compatibility with other
vendors even on the ia64, since we control the personality routine.

>> Except that would produce a call to unexpected(), which isn't right either.

> Oh, that's right, no-throw is supposed to be terminate(), isn't it.

Yes.

>> >> The cleanups don't became handlers; call sites within the inlined function
>> >> gain action records that refer to the handlers for the enclosing try
>> >> blocks.
>> 
>> > If there are no enclosing try blocks?  Say if f1 got inlined
>> > in the above example?
>> 
>> Then they still have no action records.

> They've got to have something.  To clarify:

> 	struct A { ~A(); };
> 	int x;
> 	void f1()
> 	{
> 	  A a;
> 	  f2 ();
> 	}
> 	void f0()
> 	{
> 	  f1 ();
> 	  try {
> 	    f2 ();
> 	  } catch(...) {
> 	    x++;
> 	  }
> 	}

> after inlining we have 

> 	  f2();			// L1
> 	  a.~A();
> 	  f2();			// L2
> 	R2:
> 	  return;
> 	L1:
> 	  a.~A();
> 	  _Unwind_Resume;
> 	L2:
> 	  x++;
> 	  goto R2;
	
> So L1 is cleanup only, and L2 is a handler.  As I read the
> document, however, both get an action filter of 0.

Yes, 5.4.2 confusingly mentions using an action record offset of 0 for (...);
I would expect that to mean only cleanups, and use an action record with a
type filter of 0 for (...).

> There are four cases that we want to clearly distinguish:

And how I would distinguish them:

> 	(0) Can't throw.
No call site record.

> 	(1) Can throw, no cleanup or handler this function.
Call site record, no landing pad.

> 	(2) Can throw, only cleanup this function.
Landing pad, no action record.

> 	(3) Can throw, (...) handler.
Action record, type index of 0.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]