Re: deadcode optimization

"Norman Black" <stonybrk@ix.netcom.com>
10 Mar 2001 15:52:32 -0500

          From comp.compilers

Related articles
[3 earlier articles]
Re: deadcode optimization Bjorn.DeSutter@rug.ac.be (Bjorn De Sutter) (2001-03-01)
Re: deadcode optimization guerby@acm.org (Laurent Guerby) (2001-03-01)
Re: deadcode optimization stonybrk@fubar.com (Norman Black) (2001-03-04)
Re: deadcode optimization fjh@cs.mu.OZ.AU (2001-03-08)
Re: deadcode optimization tgi@netgem.com (2001-03-08)
Re: deadcode optimization rog@vitanuova.com (2001-03-08)
Re: deadcode optimization stonybrk@ix.netcom.com (Norman Black) (2001-03-10)
Re: deadcode optimization stonybrk@ix.netcom.com (Norman Black) (2001-03-10)
Re: deadcode optimization fjh@cs.mu.OZ.AU (2001-03-10)
Re: deadcode optimization fjh@cs.mu.OZ.AU (2001-03-12)
Re: deadcode optimization stonybrk@ix.netcom.com (Norman Black) (2001-03-14)
Re: deadcode optimization stonybrk@ix.netcom.com (Norman Black) (2001-03-14)
Re: deadcode optimization broeker@physik.rwth-aachen.de (Hans-Bernhard Broeker) (2001-03-22)
[3 later articles]
| List of all articles for this month |
From: "Norman Black" <stonybrk@ix.netcom.com>
Newsgroups: comp.compilers
Date: 10 Mar 2001 15:52:32 -0500
Organization: Stony Brook Software
References: 01-03-012 01-03-022 01-03-034 01-03-060
Keywords: optimize
Posted-Date: 10 Mar 2001 15:52:32 EST

> This is not so easy: what about static variables ? You can rename
> them, but you will break debugger compatibility...


It is that easy. Modula-2 and Ada support situations just like C
static variables. No need to declare anything static, it just happens
automatically. The compiler handles this easily since all globals in a
compilation unit go into a single object which only has one bss and/or
data section. This object is the one I mentioned previously that all
other objects in the compilation unit archive refer to. Therefore the
compiler knows the address of all globals within a module via their
offset from the start of that modules bss or data section. Fixups are
output relative to the start of the data or bss section. A special
public symbol is defined that is given offset 0 from the start of the
relevant section.


I know C compiler have used the concept of local symbols but I have
never seen the need. But then C does not support compilation units
so...


--
Norman Black
Stony Brook Software


> >"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.


Post a followup to this message

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