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

Ram Bhamidipaty <ramb@spring.epic.com>
16 May 1997 23:39:58 -0400

          From comp.compilers

Related articles
Compiling to C (where C is used as misspelled assembly) bear@sonic.net (Ray Dillinger) (1997-05-14)
Re: Compiling to C (where C is used as misspelled assembly) fabre@gr.osf.org (Christian Fabre) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) fjh@mundook.cs.mu.OZ.AU (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) chase@world.std.com (David Chase) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) darius@phidani.be (Darius Blasband) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) hbaker@netcom.com (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) ramb@spring.epic.com (Ram Bhamidipaty) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) dwight@pentasoft.com (Dwight VandenBerghe) (1997-05-16)
Re: Compiling to C (where C is used as misspelled assembly) conway@mundook.cs.mu.OZ.AU (1997-05-17)
Re: Compiling to C (where C is used as misspelled assembly) fjh@mundook.cs.mu.OZ.AU (1997-05-17)
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)
[5 later articles]
| List of all articles for this month |

From: Ram Bhamidipaty <ramb@spring.epic.com>
Newsgroups: comp.compilers
Date: 16 May 1997 23:39:58 -0400
Organization: Primenet Services for the Internet
References: 97-05-183
Keywords: C, assembler

Ray Dillinger <bear@sonic.net> writes:


> I can write ... in C, ... a ... huge main() routine, ...
>
> However, this will violate every "reasonable" assumption a maker of C
> compiers will have about programming style.
>
> Will modern C systems handle this?
>
> [Probably not. Machine generated source code always seems to break
> compilers designed for code written by humans. -John]


I have a bit of experience with exactly this sort thing. I modified
Bison to produce directly executable parsers, and they were huge. For
example the gcc grammar generated a yyparse() with 24,000 lines. An
oberon grammar yielded a yyparse() with almost 10,000 lines. Both
these numbers were for the grammar only (ie no semantic code).


However there is some good news. I was able to compile the oberon
grammar on a solaris machine with their new ANSI compiler. I think I
was able to use gcc (as a compiler) as well without trouble. The
compile jobs need a fair amount of memory though. I recall the compile
needing to run on a machine with around 128 meg of main memory.


Note that since you are attempting to force the compiler to put global
variables into registers you will probably need to turn on some level
of optimization. With the code I generated there was a definite slow
down when optimization was turned off.


-Ram
--


Post a followup to this message

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