Inlined functions and their original bodies - bloat
Cecil Ward
cecil at cecilward.com
Sun Jul 9 18:04:13 UTC 2023
I have a program where the various routines are all marked
pragma( inline, true ). The compiler obeys this but the LDC and
GDC compilers still compile the function bodies even though the
bodies are not needed as they are supposed to be ‘private’ to the
module, explicitly marked as such, hoping that that is like
static in C. There are no pointers to the routines, so no need
for the bodies because of any indirect calls. Is there a way to
control this code bloat in LDC / GDC ? Using the godbolt compiler
explorer with LDC and GDC I can indeed see that the code is being
inlined. Does this count as a compiler performance-type bug?
More information about the Digitalmars-d-learn
mailing list