tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: adding COPTS to shrink kernel binary size



On Sun, Feb 05, 2023 at 08:55:53 +0900, Izumi Tsutsui wrote:

> One concern of using -Os is inline functions.
> 
> In netbsd-6 days, m68k ports also used -Os but I noticed some
> applications (especially mlterm-fb on slow luna68k framebuffers)
> were much slower (~30%) with -Os because inline functions were used
> as macro in loops for screen scroll rendering copy ops:
>  https://mail-index.netbsd.org/port-m68k/2014/06/22/msg000488.html

If they are intended to be always inlined, they should be declared
with the always_inline attribute.  -Os doesn't turn off inlining in
general, but since inlining usually does increase code size you need
to tell the compiler.  (E.g. sh3 kernel cache code does this b/c cache
must be accessed by code in uncached P2, so macro-like inline
functions must be inlined, or they will be called via their normal
addresses in the cached space.)

-uwe


Home | Main Index | Thread Index | Old Index