diff options
author | Sandra Loosemore <sloosemore@baylibre.com> | 2025-04-15 03:49:06 +0000 |
---|---|---|
committer | Sandra Loosemore <sloosemore@baylibre.com> | 2025-04-15 03:58:31 +0000 |
commit | fc89b1face0d207710eaa3d8f5af3adcffd5c5c9 (patch) | |
tree | d4db9e0c34275dba5b93fdd70caa98578533d32e /gcc | |
parent | 764f02327f7b2dc6ac5abaf89038e51cf0ee6d13 (diff) | |
download | gcc-fc89b1face0d207710eaa3d8f5af3adcffd5c5c9.zip gcc-fc89b1face0d207710eaa3d8f5af3adcffd5c5c9.tar.gz gcc-fc89b1face0d207710eaa3d8f5af3adcffd5c5c9.tar.bz2 |
Doc: always_inline attribute vs multiple TUs and LTO [PR113203]
gcc/ChangeLog
PR ipa/113203
* doc/extend.texi (Common Function Attributes): Explain how to
use always_inline in programs that have multiple translation
units, and that LTO inlining additionally needs optimization
enabled.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/doc/extend.texi | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 3a8e570..5bc2785 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -1933,6 +1933,13 @@ Note that if such a function is called indirectly the compiler may or may not inline it depending on optimization level and a failure to inline an indirect call may or may not be diagnosed. +If you need to use the inlined function in multiple translation units, +you should put the @code{always_inline} attribute on a function +definition in a header file that is included in all translation units +where the function is used. Link-time optimization can inline +functions across translation units, but only if an optimization level +that normally enables inlining is additionally specified. + @cindex @code{artificial} function attribute @item artificial This attribute is useful for small inline wrappers that if possible |