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]

[PATCH] improve memory use with a large number of pure virtual class functions


In the C++ front-end we produce a vtable with pure member functions
and we take the address of an abort function but since this abort
function never changes, really there is no reason why we cannot
share the ADDR_EXPR for the abort function.  This saves about 6M on
PR 19614 on powerpc-darwin (about 2% of the total allocated memory
and about 5M left at the end of complication or about 4.8%).  So this
is not a small micro optimization for this testcase but note this
testcase is weird in that it has more than 200 pure virtual member
functions in one of its classes.


OK? Bootstrapped and tested on powerpc-darwin with no regressions.


Thanks,
Andrew Pinski

ChangeLog:


* class.c (abort_fndecl_addr): New variable. (build_vtbl_initializer): If we have a pure virtual function share the abort function's address. Include gt-cp-class.h at the end. * config-lang.in (gtfiles): Add cp/class.c.

Attachment: temp.diff.txt
Description: Text document


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