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]
Other format: [Raw text]

Re: __attribute__((cleanup(function)) versus try/finally


> X-Original-To: geoffk@foam.wonderslug.com
> Date: Tue, 13 May 2003 14:24:26 -0700
> From: Richard Henderson <rth@redhat.com>
> Cc: Mike Stump <mrs@apple.com>, Jason Merrill <jason@redhat.com>,
>    gcc@gcc.gnu.org
> Mail-Followup-To: Richard Henderson <rth@redhat.com>,
> 	Geoff Keating <geoffk@geoffk.org>, Mike Stump <mrs@apple.com>,
> 	Jason Merrill <jason@redhat.com>, gcc@gcc.gnu.org
> Content-Disposition: inline
> User-Agent: Mutt/1.4i
> X-OriginalArrivalTime: 13 May 2003 21:28:01.0403 (UTC) FILETIME=[880084B0:01C31996]
> 
> On Mon, May 12, 2003 at 05:07:36PM -0700, Geoff Keating wrote:
> > For instance, much of the information in the tables is included in the
> > object code (nearly all of it in the case of routines that don't
> > actually have cleanups).  It wouldn't be that hard to write a routine
> > that, given a return address, can determine what registers need to be
> > restored and from where in 90% of the cases by looking at the object
> > code; those routines (in the 90%) can have an abbreviated EH entry
> > that just says "use the object code", and the remaining 10% could have
> > a real EH entry.
> 
> If you have an entry at all, it means you know the extent of the
> function being described.  So you know where the entry point is.
> So no searching for that.  You'd just read forward from the start.
> 
> However, if you make the prologue regular enough that code reading
> is going to work, you're talking about *maybe* 2 bytes per saved
> register in the EH information, at which point I disbelieve that
> we're saving enough data space to make this worthwhile.

I was thinking that what you'd do is simply block out large regions of
the program with "if you want EH information in here, go look at the
object code", so entries would be combined: more space saving, but you
do have to search backwards.

I wasn't thinking of changing the prologue at all; the plan would be
to make the object-code reader sufficiently robust that it can handle
most routines, and to include a check for whether this particular
routine can be handled by the object-code reader.  The reader would
do things like skip over opcodes that it didn't understand.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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