When some object having empty destructor is declared as static in the local context of some function g++ still inserts <atexit> call with the empty handler like <__tcf_0> below.
It may seem like minor issue but redundant instructions increase chances for I-cache misses and worthen processor pipeline. Yuri 08048800 <__tcf_0>: 8048800: 55 push %ebp 8048801: 89 e5 mov %esp,%ebp 8048803: 5d pop %ebp 8048804: c3 ret --testcase-- begin 644 case-empty-atexit.tgz M'XL(`.1G^4$``^V6VVJ#0!"&O=ZG&-*;))!D/:Q>)!1"GV31:2.83=`U&$KZ M[!U-BI)#<U%)"YT/85?\]Z#C/[.Q+G""ZZW=3[3%*K4SIW>D#&2D%+5*JLBG M5DHW4$U[PG&E&X5>Z(>^YTC7#X/(`=7_5BXI"ZMS`&[EMAIL PROTECTED]&VVC]C2 M(XDOXE]-7WI>0[I2AD%P,_X4^:_XUW\`Z0//"QV0/>_C*O\\_D(\I2;[EMAIL PROTECTED] M4$U7`R&PLI@;V&W2!,H"AZ.Y$/2-;!K#$C3=B+5.S7`$[P(@[EMAIL PROTECTED] [EMAIL PROTECTED])[EMAIL PROTECTED]/)4.^PHSF(WWY[YIK_5SVO<<__7NM_GZ2-_U7$_G\$'?\O MTDUA<]3K9U$6J7D#H]=8;'6,4-BDR0)Y&5O*`K7SEW4&:+V]I*XY"C!I/0X' MDC:IY-6<#Z`$<:[\.,XZ&W=D"5Y..YZ1_##G_/%CKOA_0H'I]0QPM_Y+U=;_ M*"*]HHO]_PANE?]CJ6\/`8WGN\<``#VM/<UEG&$8AF$8AF$8AF$8AF$8AF$8 -AF'^#)_;GM5=`"@````` ` end -- Summary: many redundant atexit calls emitted into the executable for static objects with empty destructors Product: gcc Version: 3.4.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: yuri at tsoft dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: n/a GCC target triplet: n/a http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19661