Patch to -Os

Joe Buck jbuck@synopsys.com
Sat Jan 31 18:04:00 GMT 1998


> The idea is that a function call is at least 1 instruction (call) plus 1.5
> instructions per argument (well, constants are one or two insns, simple
> variables are one or two insns..), so doing the inline with small functions
> might be even better than calling them, since the actual call needs more
> instructions (there _are_ such functions!)

Yes, such functions are extremely common in C++ (e.g. a member function that
just returns some field of a class).  Out-of-line calls will not save
space.  It would make sense to always inline extremely small functions,
for a suitable definition of small, even when optimizing for space.






More information about the Gcc mailing list