low level optimization

Jim Giles jlg at cochiti.lanl.gov
Fri Apr 19 10:23:05 AEST 1991


In article <1991Apr18.233807.19552 at zoo.toronto.edu>, henry at zoo.toronto.edu (Henry Spencer) writes:
|> In article <21846 at lanl.gov> jlg at lanl.gov (Jim Giles) writes:
|> >if the user chooses only to recompile one file and not any of the others
|> >(which is allowed by the "may" clause), the implementation _must_ allow
|> >this to be linked with the previously translated files to produce a
|> >program.
|> 
|> Of course, it may not run as fast as if he had compiled them all together.

I see that I'm going to have to give a specific example.  Suppose
that functions A and B are in two separate files.  Suppose that
I compile them 'together' in some way (that is, the compiler makes
some use of internal knowledge of B while translating A and vice-versa).
Now, suppose I _change_ A and retranslate just A (I do _not_ retranslate
B).  The standard requires that I still be able to link both into a
single program.  If the translation of B made any _profitable_ use
of internal information about A, then that information is obsolete
(and probably downright _wrong_) after A has been changed.  Yet, the
standard requires that the new version of A still be usable with the
previously translated B.  Either the use the translator made of the
interprocedural analysis was trivial, or B will contain unsafe
optimizations - the only third way is if 'translation' does not
include code generation (which will subsequently be done by some
post-translation tool: like the loader - just like I keep saying).

I don't understand why you continue to hang on like grim death
to the fiction that dependent compilation satisfies the requirements
of the standard.

J. Giles



More information about the Comp.lang.c mailing list