Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!wuarchive!sdd.hp.com!elroy.jpl.nasa.gov!lll-winken!sun-barr!olivea!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!edcastle!aiai!aipna!cstr!rjc From: rjc@cstr.ed.ac.uk (Richard Caley) Newsgroups: comp.lang.c Subject: Re: low level optimization Message-ID: Date: 20 Apr 91 02:38:16 GMT References: <21660@lanl.gov> <1991Apr17.225944.15261@zoo.toronto.edu> <1991Apr18.190403.29049@Think.COM> <21846@lanl.gov> <1991Apr18.233807.19552@zoo.toronto.edu> <21868@lanl.gov> Sender: news@aipna.ed.ac.uk Organization: Centre for Speech Technology Research Lines: 31 In-reply-to: jlg@cochiti.lanl.gov's message of 19 Apr 91 00:23:05 GMT In article <21868@lanl.gov>, Jim Giles (jg) writes: jg> Suppose jg> that functions A and B are in two separate files. Suppose that jg> I compile them 'together' in some way (that is, the compiler makes jg> some use of internal knowledge of B while translating A and vice-versa). jg> Now, suppose I _change_ A and retranslate just A (I do _not_ retranslate jg> B). The standard requires that I still be able to link both into a jg> single program. If the translation of B made any _profitable_ use jg> of internal information about A, then that information is obsolete jg> (and probably downright _wrong_) after A has been changed. Yet, the jg> standard requires that the new version of A still be usable with the jg> previously translated B. Either the use the translator made of the jg> interprocedural analysis was trivial, or B will contain unsafe jg> optimizations - the only third way is if 'translation' does not jg> include code generation (which will subsequently be done by some jg> post-translation tool: like the loader - just like I keep saying). Fourth option: When compiling `together' the compiler creates object files containing two complete sets of code, data etc. The linker looks at the object files given and if they were not all compiled together (eg if you had recompiled one) it uses the non-optimised code. I'm sure the net.experts can come up with much better solutions, this is simply the one which was most obvious to me. -- rjc@cstr.ed.ac.uk _O_ |<