low level optimization

Steve Emmerson steve at groucho.ucar.edu
Sat Apr 20 05:31:40 AEST 1991


In <21961 at lanl.gov> jlg at cochiti.lanl.gov (Jim Giles) writes:

>To reiterate, the standard says I may link translated files to previously
>translated ones to form programs.  It places no constraints on this.  As
>long as each translated file is itself standard conforming, linking them
>together is a capability required by the standard.

Hmm...  it appears you didn't understand  what I was trying to say so I
must not have stated it clearly enough.  Let me try again.

In my opinion the following two scenarios do not violate the standard
and yet allow for global-optimization *and* incremental
compilation (though not necessarily at the same time).

Scenario #1 (demonstration of global-optimization):

	$ cc -O3 -o foobar.o -c foo.c bar.c
	$ cc foobar.o

Scenario #2 (demonstration of the *required* functionality of incremental
compilation):

	$ cc -O -c foo.c
	$ cc -O -c bar.c
	$ cc foo.o bar.o

Since, in the above, one can't do both global-optimization and
incremental compilation at the same time, I suppose one could argue
that the above implementation doesn't conform to the standard (at least
when performing global-optimization).  This might be true, but I
consider it unimportant because, to me at least, the important issues
are

	1) whether or not the *language* disallows global-optimization 
	   (it does not); and 

	2) whether or not the standard *forbids* behavior or
	   capabilities outside its scope (it cannot).

I'll second Barry's sugestion about the MIPS C compiler.

Steve Emmerson        steve at unidata.ucar.edu        ...!ncar!unidata!steve



More information about the Comp.lang.c mailing list