dead code removal

Jeremy Fitzhardinge jeremy at goop.org
Sun Dec 19 07:08:59 EST 1999


On 25-Nov-99 Jeffrey Karl Lassahn wrote:
> In principle it can be if the function is marked static (so the compiler
> knows it will never link outside the module.)  Does anyone know if GCC
> does remove the code in this case?

No, only if its inline.  Just because the compiler can't see a reference, it
doesn't mean one isn't there - inline assember may refer to the static function.

Basically, you need the linker to strip dead functions, because nothing else
has enough information to do it right.

        J

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-dev mailing list