I try migrate to gcc 7.2 from gcc 4.9 (gcc-arm-none-eabi, -O2). My code builds successfully, but result program is bigger than on gcc 4.9.
I make some investigation and realize, that size of "non virtual thunk on xxx" is too big, if overriding function defined in class:
struct IA { virtual void fa() = 0; };
struct IB { virtual void fb() = 0; };
struct C : IA, IB {
void fa() override {}
void fb() override // If I place definition here,
// size of "non virtual thunk to C::fb()" is almost the same, as the function itself
};
// but if I place definition outside the class,
// size of non virtual thunk is about 6-8 bytes, same as in gcc4.9
There may be a option that prevents such inlining?