Re: Caller/Callee saved Registers

hbaker@netcom.com (Henry G. Baker)
Sat, 26 Mar 1994 16:50:32 GMT

          From comp.compilers

Related articles
[14 earlier articles]
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-24)
Re: Caller/Callee saved Registers bart@cs.uoregon.edu (1994-03-25)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-25)
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-25)
Re: Caller/Callee saved Registers zsh@cs.princeton.edu (1994-03-25)
Re: Caller/Callee saved Registers law@fast.cs.utah.edu (1994-03-26)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
Re: Caller/Callee saved Registers hbaker@netcom.com (1994-03-26)
Re: Caller/Callee saved Registers anton@mips.complang.tuwien.ac.at (1994-03-28)
Re: Caller/Callee saved Registers zsh@cs.princeton.edu (1994-03-27)
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-28)
Re: Caller/Callee saved Registers pardo@cs.washington.edu (1994-03-29)
[9 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: hbaker@netcom.com (Henry G. Baker)
Keywords: registers, optimize
Organization: nil
References: 94-03-054 94-03-131
Date: Sat, 26 Mar 1994 16:50:32 GMT

I wrote:
>I've been told that the C compilers
>for several machines implement at least two different entry points for
>some functions.


The moderator writes:
>This means that a procedure has two addresses, its code
>address and its data address, so a function pointer would be two words
>long. But large amounts of badly written C code will crash and burn if
>all pointers aren't the same size, so compiler writers finesse it by
>making a procedure pointer actually point to a little stub that loads up
>the data pointer and jumps to the code. That's the second entry point.


I can't tell you what pleasure and glee your comment gives me! One of the
reasons why C is supposedly better than languages like Pascal (or Lisp)
which support nested environments is that it makes the passing of
procedures as arguments trivial -- there is no need for passing both a
code and an environment argument. However, your comment indicates that
this supposed advantage is indeed illusory, and C's insistence on an
unrealistically simple model actually makes things worse!


Of course, the real answer is that programming _styles_ are more important
than languages in determining proper implementations. The C programmer's
heavy use of 'extern' globals (which is forced by the lack of nested
environments) must be supported, and since this model does not scale well
at all, the use of C 'static' (file-scoped) variables becomes very
important. When you then add in the requirement for sharing libraries,
something has to give.


However, I don't get much pleasure in saying 'I told you so', since we are
all stuck with the fallout from this fiasco.
--


Post a followup to this message

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