Re: deadcode optimization (Fergus Henderson)
8 Mar 2001 12:27:43 -0500

          From comp.compilers

Related articles
deadcode optimization (Elie Khoury) (2001-03-01)
Re: deadcode optimization (2001-03-01)
Re: deadcode optimization (Hans-Bernhard Broeker) (2001-03-01)
Re: deadcode optimization (Bjorn De Sutter) (2001-03-01)
Re: deadcode optimization (Laurent Guerby) (2001-03-01)
Re: deadcode optimization (Norman Black) (2001-03-04)
Re: deadcode optimization (2001-03-08)
Re: deadcode optimization (2001-03-08)
Re: deadcode optimization (2001-03-08)
Re: deadcode optimization (Norman Black) (2001-03-10)
Re: deadcode optimization (Norman Black) (2001-03-10)
Re: deadcode optimization (2001-03-10)
Re: deadcode optimization (2001-03-12)
[6 later articles]
| List of all articles for this month |

From: (Fergus Henderson)
Newsgroups: comp.compilers
Date: 8 Mar 2001 12:27:43 -0500
Organization: Computer Science, University of Melbourne
References: 01-03-012 01-03-022 01-03-034
Keywords: linker, optimize
Posted-Date: 08 Mar 2001 12:27:43 EST

"Norman Black" <> writes:

>"Smart linking" is trivial for a compiler do handle and have ALL
>linkers in existence support the unused code "removal".
>All that need be done is have the compiler output library/archive
>files directly with one procedure per object in the library. Our
>compilers have done this since 1987 and any linker appropriately does
>not link in unused code.
>I know Microsoft added objects file extensions, COMDAT, and therefore
>needed linker support to smart link. Others have used extensions to do
>this. I have never understood why.

I think the main reason is that typical object file formats and
library formats have a lot of overhead per object file. Compiling
each function to its own object file results in much larger object and
library files, and as a result can also increase compilation and link
times. I implemented the same kind of thing in the Mercury compiler
in 1996, but it remains an option, not the default, because of the
large increase in the intermediate file sizes and in compilation /
link time. It's useful if you're cross-compiling to some small-memory
system, or if for some other reason you're very concerned about
reducing code size, but otherwise it's not worth the hassle.

Fergus Henderson <> | "I have always known that the pursuit
                                                                        | of excellence is a lethal habit"
WWW: <> | -- the last words of T. S. Garp.

Post a followup to this message

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