Re: Pros and cons of high-level intermediate languages

henry@zoo.toronto.edu (Henry Spencer)
Thu, 23 Jul 1992 17:03:03 GMT

          From comp.compilers

Related articles
[2 earlier articles]
Re: Pros and cons of high-level intermediate languages chased@rbbb.Eng.Sun.COM (1992-07-21)
Re: Pros and cons of high-level intermediate languages bbx!bbx.basis.com!scott@unmvax.cs.unm.edu (1992-07-22)
Re: Pros and cons of high-level intermediate languages shankar@sgi.com (1992-07-23)
Re: Pros and cons of high-level intermediate languages Olivier.Ridoux@irisa.fr (1992-07-23)
Re: Pros and cons of high-level intermediate languages fjh@munta.cs.mu.OZ.AU (1992-07-23)
Re: Pros and cons of high-level intermediate languages tmb@idiap.ch (1992-07-23)
Re: Pros and cons of high-level intermediate languages henry@zoo.toronto.edu (1992-07-23)
Re: Pros and cons of high-level intermediate languages tarvydas@tsctrl.guild.org (1992-07-23)
Re: Pros and cons of high-level intermediate languages graham@maths.su.oz.au (1992-07-24)
Re: Pros and cons of high-level intermediate languages acha@CS.CMU.EDU (1992-07-24)
Re: Pros and cons of high-level intermediate languages graham@maths.su.oz.au (1992-07-25)
Re: Pros and cons of high-level intermediate languages fjh@munta.cs.mu.OZ.AU (1992-07-25)
Re: Pros and cons of high-level intermediate languages moss@cs.umass.edu (1992-07-25)
[19 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: henry@zoo.toronto.edu (Henry Spencer)
Organization: U of Toronto Zoology
Date: Thu, 23 Jul 1992 17:03:03 GMT
Keywords: C, optimize
References: 92-07-064 92-07-073

shankar@sgi.com (Shankar Unni) writes:
>This is totally bogus. Let us assume that the ANSI spec were to say: local
>variables are guaranteed to retain their values when a longjmp() takes you
>back to the stack.
>
>Now how would this be done on a machine with several registers ...


The right way to do it is to have the compiler recognize the presence of
setjmp() -- ANSI C carefully restricts setjmp() usage so this is
guaranteed to be possible -- and take suitable precautions.


That is a little tricky in a simple one-pass compiler. What such a
compiler can do, however, is note the presence of the <setjmp.h> header,
and take worst-case precautions for code compiled with that header
visible.


Historical practice is to say that variables marked "register" can lose
their values, and others can't. Any compiler smart enough to silently
promote variables into registers ought to be able to handle one of the
above strategies.


And yes, some of us said these things to X3J11, but they didn't listen...
--
Henry Spencer @ U of Toronto Zoology, henry@zoo.toronto.edu utzoo!henry
--


Post a followup to this message

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