This is the mail archive of the gcc-patches@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] |
Other format: | [Raw text] |
GCC emits BINCL/EINCL stabs for a header even if its content is #ifdef'ed out. This results in empty BINCL/EINCL pair. Now, use of -gused (my previous patch) introduces even more empty pairs. And in PCH usage model, precomp contains tons of empty BINCL/EINCLs with -gused (because not many symbols are used while pre-compiling prefix header). So this patch introduces empty BINCL/EINCL optimization by emitting BINCL stabs lazily. If BINCL stab is pending when it is time to emit EINCL stab, it eliminates entire pair. It has significant impact on size of .o files created.
Here is size comparison for h.cc and h.c. - h.cc is a three line hello world program that includes iostream.h. and uses std::cout. -h.c is hello world using printf(). - EBEO = empty BINCL/EINCL optimization
-g -gused -g -gused no dbg name + EBEO + EBEO
125908 10904 121324 4052 2488 h.cc 6452 1612 6240 1032 812 h.c
One added benefit is that this has significant positive impact on GDB startup time.
Attachment:
empty_bincl.diff
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |