From owner-freebsd-current Sat Dec 2 23:51:17 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id XAA29941 for current-outgoing; Sat, 2 Dec 1995 23:51:17 -0800 Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id XAA29933 for ; Sat, 2 Dec 1995 23:51:11 -0800 Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id SAA15385; Sun, 3 Dec 1995 18:47:38 +1100 Date: Sun, 3 Dec 1995 18:47:38 +1100 From: Bruce Evans Message-Id: <199512030747.SAA15385@godzilla.zeta.org.au> To: imb@scgt.oz.au, julian@ref.tfs.com Subject: Re: changes in -current..TEST please Cc: current@freebsd.org Sender: owner-current@freebsd.org Precedence: bulk >> > > loading kernel >> > > kern_xxx.o: Undefined symbol `_dummy_cleanup' referenced >> > > *** Error code 1 >GCC, at optimisation levels > 1, will remove data (and code) which it >considers to be unreferenced. _dummy_cleanup is declared 'static' yet is >unreferenced in the file in which it appears. Given that 'static' implies Actually, gcc, at optimization levels > 2 or if -finline-functions is used, turns static functions into static inline functions. In all cases except when -fkeep-inline-functions is used, if a static inline function is simple enough to be integrated into its callers, the code for the function is not output separately. dummy_cleanup() is simple enough to integrate into anything so it gets deleted. >'local to this file', this is valid behaviour. However, since the variable >in question really is intended to be used by things external to kern_xxx.c, >perhaps it should not be declared 'static' and GCC will leave it alone at >all optimisation settings .. Perhaps the unsupported -O3 shouldn't be used. Many things that can reasonably be inlined already are. Excessive inlining can slow things down (even for functions that are only referenced once, inlining sometimes makes their callers too hard to optimize). How much slower was -O3? :-) Bruce