This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: never-used inlines becoming statics


On Sat, 5 Sep 1998, Martin von Loewis wrote:

: > One code bloat problem in egcs 1.1 - which I'm considering a _bug_
: > because bastring.cc is now unconditionally included by bastring.h -
: > is the generation of statics for inlines that are never used or
: > referenced at all.
: 
: Operating system?

NetBSD (any platform).  Can be reproduced on Solaris, SunOS, and OSF/1
(that's all the stuff I have access to).

: 000000b5 ? .L1833
:          [more exception frames omitted]

Um, hello?  Why do the exception frames _exist_?  I'd _love_ to see the size
information for the ones you omitted.

: 00000000 W _t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0.nilRep
: 00000000 W _t23__malloc_alloc_template1i0.__malloc_alloc_oom_handler
: 00000000 W _t24__default_alloc_template2b1i0.__node_allocator_lock
: 00000000 W _t24__default_alloc_template2b1i0.end_free
: 00000000 W _t24__default_alloc_template2b1i0.free_list
: 00000000 W _t24__default_alloc_template2b1i0.heap_size
: 00000000 W _t24__default_alloc_template2b1i0.start_free
: 00000000 W chunk_alloc__t24__default_alloc_template2b1i0UiRi
: 00000000 W clone__Q2t12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0_3Rep
: 00000000 t gcc2_compiled.
: 00000000 W oom_malloc__t23__malloc_alloc_template1i0Ui
: 00000000 W refill__t24__default_alloc_template2b1i0Ui
: 
: So I can see exactly one static symbol, gcc2_compiled. This is
: intentional and not a bug. The other symbols are all weak: If you link
: the program, duplicates of them will be removed (at least on my
: system).
: 
: In short, I cannot reproduce the problem.

You're reproducing the problem, just that your linker can partially cope by
the use of weak symbols.  However, not all linkers can remove common code
this way - and this code SHOULD NOT BE GENERATED IF IT IS NOT USED.  In
other words, the only thing the source file

=====
#include <stdexcept>
=====

should generate is the symbol "gcc2_compiled".  That's all.

-- 
-- Todd Vierling (Personal tv@pobox.com; Bus. todd_vierling@xn.xerox.com)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]