Re: C as assembly language

andi@complang.tuwien.ac.at (Andreas Krall)
10 Apr 2001 01:20:34 -0400

          From comp.compilers

Related articles
Optimizing in assembly language rhyde@transdimension.com (Randall Hyde) (2001-03-01)
Re: Optimizing in assembly language sunni@speakeasy.net (Shankar Unni) (2001-03-04)
Re: Optimizing in assembly language sunni@speakeasy.net (Shankar Unni) (2001-03-26)
C as assembly language joachim_d@gmx.de (Joachim Durchholz) (2001-04-04)
Re: C as assembly language eodell@c1220335-a.potlnd1.or.home.com (2001-04-10)
Re: C as assembly language andi@complang.tuwien.ac.at (2001-04-10)
Re: C as assembly language jmorris2@twcny.rr.com (Morrisett) (2001-04-10)
Re: C as assembly language jacob@jacob.remcomp.fr (jacob navia) (2001-04-10)
Re: C as assembly language felixundduni@freenet.de (felix) (2001-04-10)
Re: C as assembly language fjh@cs.mu.OZ.AU (2001-04-10)
Re: C as assembly language fjh@cs.mu.OZ.AU (2001-04-12)
Re: C as assembly language vbdis@aol.com (2001-04-12)
[11 later articles]
| List of all articles for this month |
From: andi@complang.tuwien.ac.at (Andreas Krall)
Newsgroups: comp.compilers
Date: 10 Apr 2001 01:20:34 -0400
Organization: Vienna University of Technology, Austria
References: 01-03-006 01-03-046 01-03-130 01-04-027
Keywords: C
Posted-Date: 10 Apr 2001 01:20:34 EDT

"Joachim Durchholz" <joachim_d@gmx.de> writes:
> Hmm... there are a few additional cases where C is simply inappropriate:
...
>
> Oh, and slightly off-topic, there are a few other things that annoy
> those who want to use C as a backend for their compiler:
> 3) It has no support for tail call recursion.
> 4) It has no support for automatic garbage collection.
> (The following are from http://www.cminusminus.org/faq.html:)
> 5) It cannot return multiple values in registers
> 6) It cannot bind global variables to registers


Here you mix up the language definition of C with current
implementions of C compilers. Some C compilers do not implement the
above mentioned features, but many implement proper tail call
recursion, structs and unions returns in registers and interprocedural
register allocation. One of my students has implemented proper tail
recursion for GCC for the x86 and the Alpha backend. His master thesis
and the code will be available very soon from our web server.


ad 4) There is always the Boehm/Weiser GC


ad 5)
Just read the calling conventions for differnt compilers, e.g.: SGI
calling conventions:


A struct with only one or two floating point fields is returned in $f0
(and $f2 if needed).
Any other struct or union results of at most 128 bits are returned in $2
and $3 (remainder if necessary).


--
andi@complang.tuwien.ac.at Andreas Krall
http://www.complang.tuwien.ac.at/andi/ Inst. f. Computersprachen, TU Wien
tel: (+431) 58801/18511 Argentinierstr. 8/4/1851
fax: (+431) 58801/18598 A-1040 Wien AUSTRIA EUROPE


Post a followup to this message

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