Re: Compiling to C (where C is used as misspelled assembly)

fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
25 May 1997 12:59:49 -0400

          From comp.compilers

Related articles
[10 earlier articles]
Re: Compiling to C (where C is used as misspelled assembly) monnier+/news/comp/compilers@tequila.cs.yale.edu (Stefan Monnier) (1997-05-17)
Re: Compiling to C (where C is used as misspelled assembly) cdg@nullstone.com (Christopher Glaeser) (1997-05-17)
Re: Compiling to C (where C is used as misspelled assembly) conway@mundook.cs.mu.OZ.AU (1997-05-22)
Re: Compiling to C (where C is used as misspelled assembly) conway@mundook.cs.mu.OZ.AU (1997-05-22)
Re: Compiling to C (where C is used as misspelled assembly) Dave@occl-cam.demon.co.uk (Dave Lloyd) (1997-05-22)
Re: Compiling to C (where C is used as misspelled assembly) partain@dcs.gla.ac.uk (Will Partain) (1997-05-22)
Re: Compiling to C (where C is used as misspelled assembly) fjh@mundook.cs.mu.OZ.AU (1997-05-25)
Re: Compiling to C (where C is used as misspelled assembly) fjh@mundook.cs.mu.OZ.AU (1997-05-25)
| List of all articles for this month |

From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson)
Newsgroups: comp.lang.scheme,comp.compilers
Date: 25 May 1997 12:59:49 -0400
Organization: Comp Sci, University of Melbourne
References: 97-05-183 97-05-197 97-05-249
Keywords: C, assembler

conway@mundook.cs.mu.OZ.AU (Thomas Charles CONWAY) writes:


>he [Fergus] wrote an equivalent piece
>of C code (all in one module) which passed and returned structures,
>just as the Mercury code did. He tried several C compilers - even
>with `const' in all the right places (etc), the compiler didn't do any
>inlining, and created the intermediate structures even though it
>should have been painfully obvious to do so.


Minor correction: the C compilers did do the inlining.
The problem was that they only optimized away the "call" and "return"
instructions. They didn't optimize away the parameter passing/returning.
They generated code that spent a lot of time unnecessarily
storing data on the stack, copying data from one location on the stack
to another, and then loading it from the stack into registers again.


--
Fergus Henderson <fjh@cs.mu.oz.au>
WWW: <http://www.cs.mu.oz.au/~fjh>
PGP: finger fjh@128.250.37.3
--


Post a followup to this message

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