Translations:GCC optimization/185/en
This flag is meant to improve code generation quality and can provide greater performance (default at -Ofast
). The default behavior (-fsemantic-interposition
) follows the ELF standard, which allows interposing of symbols by the dynamic linker. While this might sound useful in certain cases it prevents the compiler from doing extensive code analyses and optimizations (in particular the compiler will not attempt inlining unless the functions have been specifically declared as inlined). Contrary to popular belief, enabling this flag globally is safe (unless interposing symbols is required, for example when using different allocators on system libraries), but the reason for it not being enabled by default is to comply with the ELF standard. In contrast, this flag is part of the default when using Clang.