I have looked up the changes that C99 brought to the inline keyword and changed the functions that threw an error to static inline and this results in no code size regression.
I believe all the cases that blew up the code size by a larger margin (40+ byte) came from the compiler not inlining the functions. -Winline seems to be a good addition to the build scripts to spot this kind of stuff, in my opinion.
I'll try to figure out why GCC 5 uses one instruction less in versions 4.9, 6 and 7 and if it's a bug in GCC 5 that produces smaller, but incorrect code or if it's a code size regression in 6 and 7.
I have looked up the changes that C99 brought to the inline keyword and changed the functions that threw an error to static inline and this results in no code size regression.
GCC 7
static inline
-std=gnu11 1022 bytes
-std=gnu99 1022 bytes
-std=gnu89 1026 bytes
-std=gnu11 -fgnu89-inline 1026 bytes
-std=gnu99 -fgnu89-inline 1026 bytes
-std=gnu89 -fgnu89-inline 1026 bytes
GCC 5
static inline
-std=gnu11 1020 bytes
-std=gnu99 1020 bytes
-std=gnu89 1024 bytes
-std=gnu11 -fgnu89-inline 1024 bytes
-std=gnu99 -fgnu89-inline 1024 bytes
-std=gnu89 -fgnu89-inline 1024 bytes
Has static inline regressions on your GCC 4.9?
I believe all the cases that blew up the code size by a larger margin (40+ byte) came from the compiler not inlining the functions. -Winline seems to be a good addition to the build scripts to spot this kind of stuff, in my opinion.
I'll try to figure out why GCC 5 uses one instruction less in versions 4.9, 6 and 7 and if it's a bug in GCC 5 that produces smaller, but incorrect code or if it's a code size regression in 6 and 7.