I have object files containing moderately sized functions (approximately 256 FLOPs each, no loops) that are called from a .c file. I would like to force the inlining of these functions during Link-Time Optimizations available on GCC (-flto), as they are not being inlined automatically. Is there any way to do this?
Asked
Active
Viewed 229 times
2
-
Have you tried [function attribute always_inline](https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-always_005finline-function-attribute)? – ssbssa Mar 28 '20 at 13:30
-
Thanks for your answer. Unfortunately, I had tried this solution and it does not work. It fails at the compilation stage, as the *compiler* is unable to inline the call due to the code being unavailable. – Harkonnen Mar 28 '20 at 13:41
-
Which gcc version are you using, because apparently the size limits for inlining were increased in gcc 9. – ssbssa Mar 28 '20 at 14:42
-
Currently using GCC 9.2.1. – Harkonnen Mar 28 '20 at 14:45