Re: Register allocation in special circumstancies

Vince Del Vecchio <vince.delvecchio@spd.analog.com>
15 Feb 2001 00:33:52 -0500

          From comp.compilers

Related articles
Register allocation in special circumstancies ruff@mcst.ru (Andrey S. Bokhanko) (2001-02-01)
Re: Register allocation in special circumstancies andyjnsn@ma.ultranet.com (Andy Johnson) (2001-02-04)
Re: Register allocation in special circumstancies thp@hill.cs.ucr.edu (Tom Payne) (2001-02-04)
Re: Register allocation in special circumstancies christian.bau@isltd.insignia.com (2001-02-04)
Re: Register allocation in special circumstancies torbenm@diku.dk (2001-02-12)
Re: Register allocation in special circumstancies fjh@cs.mu.OZ.AU (2001-02-15)
Re: Register allocation in special circumstancies christian.bau@isltd.insignia.com (2001-02-15)
Re: Register allocation in special circumstancies vince.delvecchio@spd.analog.com (Vince Del Vecchio) (2001-02-15)
Re: Register allocation in special circumstancies dmr@bell-labs.com (Dennis Ritchie) (2001-02-15)
| List of all articles for this month |

From: Vince Del Vecchio <vince.delvecchio@spd.analog.com>
Newsgroups: comp.compilers
Date: 15 Feb 2001 00:33:52 -0500
Organization: Analog Devices Inc., CPD
References: 01-02-014 01-02-048
Keywords: C, optimize
Posted-Date: 15 Feb 2001 00:33:52 EST

>>>>> On 12 Feb 2001 01:16:04 -0500,
      torbenm@diku.dk (Torben AEgidius Mogensen) said:


> The simplest thing would be to wrap every setjmp inside a function,
> which isn't inlined. This way, it won't affect the register allocation
> of the function that uses setjmp. And inside the new function you have
> a well-defined register state defined by the calling convention, which
> makes saving the state fairly simple.


You can't wrap only the setjmp, because part of the definition of
longjmp says that the caller of setjmp must not have returned when
longjmp is called. (Otherwise the stack frame of the function you
setjmp'd from will have been clobbered by the time you longjmp back.)


Perhaps you meant that one should put setjmp at the beginning of a
function, and all the code which might call longjmp inside the function.
An optimizer designed to deal with that case ought to be able to do a
good job with it (both in terms of optimization and actually preserving
non-volatile variable values).


-Vince Del Vecchio


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.