Re: Data Structure Reorganizing Optimizations

ddg@cci.com (D. Dale Gulledge)
Mon, 31 Oct 1994 22:43:55 GMT

          From comp.compilers

Related articles
[2 earlier articles]
Re: Data Structure Reorganizing Optimizations robertb@HING.LCS.MIT.EDU (1994-10-26)
Re: Data Structure Reorganizing Optimizations johnm@cory.EECS.Berkeley.EDU (1994-10-22)
Re: Data Structure Reorganizing Optimizations stripes@uunet.uu.net (1994-10-27)
Re: Data Structure Reorganizing Optimizations bret@icicle.winternet.com (1994-10-23)
Data Structure Reorganizing Optimizations leichter@zodiac.rutgers.edu (1994-10-31)
Re: Data Structure Reorganizing Optimizations yuri@shimari.cmf.nrl.navy.mil (1994-10-31)
Re: Data Structure Reorganizing Optimizations ddg@cci.com (1994-10-31)
Re: Data Structure Reorganizing Optimizations amos@nsof.co.il (1994-11-01)
Re: Data Structure Reorganizing Optimizations pardo@cs.washington.edu (1994-10-31)
Re: Data Structure Reorganizing Optimizations fjh@munta.cs.mu.OZ.AU (1994-11-02)
Re: Data Structure Reorganizing Optimizations jeremy@sour.sw.oz.au (1994-11-02)
Re: Data Structure Reorganizing Optimizations prochak@cibadiag.com (1994-11-02)
Re: Data Structure Reorganizing Optimizations pardo@cs.washington.edu (1994-11-09)
[11 later articles]
| List of all articles for this month |
Newsgroups: comp.arch,comp.compilers
From: ddg@cci.com (D. Dale Gulledge)
Keywords: C, optimize, design
Organization: Northern Telecom Inc., NAS
References: 94-10-108 94-10-157
Date: Mon, 31 Oct 1994 22:43:55 GMT

robertb@HING.LCS.MIT.EDU (Robert Bedichek) writes:


      4. Applications and utilities that make system calls like 'stat()'
            where the operating system's compilation used a different layout
            for the stat buffer.


This is actually a special case of the real driving reason behind the
restriction. C, and therefor C++, allows separate compilation of multiple
compilation units. The compiler has no knowledge of the internals of other
compilation units or any optimizations that may have been done on them, unless
those optimizations would have always been performed. If it is necessary to
pad so that individual fields have a certain alignment, the compiler may be
able to guarantee that. However, completely rearranging the actual layout for
optimization is non-trivial at best and may not be possible in the general
case.


This is not limited to C/C++, but can be extended to any compiler that allows
linking separately compiled modules in such a way that the compiler cannot or
even might not use information generated by the compilation of one module in
the compilation of another module. So long as the optimization may be done at
compile time and the modules are linked later, the problem exists. Making the
optimization optional only exacerbates the problem. If the optimizer is
enabled when one module is compiled and disabled when another that interfaces
it is compiled, the interface will fail.


Simply put, you cannot optimize an interface, unless you can guarantee that
both sides can accept either the optimized or non-optimize versions, or that
both sides will be optimized the same way.


- Dale
--
ddg@cci.com, D. Dale Gulledge, Software Engineer, Northern Telecom,
Directory & Operator Services, 97 Humboldt St., Rochester, NY 14609
--


Post a followup to this message

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