This helps the compiler to split the cold path into a separate clone, so
that the hot path is a smaller function that uses less icache, and the
cold path is only fetched into the icache if actually executed.
libstdc++-v3/ChangeLog:
PR libstdc++/117650
* include/bits/c++config (__glibcxx_assert_fail): Add cold
attribute.
* include/debug/formatter.h (_Error_formatter::_M_error):
Likewise.
{
#pragma GCC visibility push(default)
// Don't use <cassert> because this should be unaffected by NDEBUG.
- extern "C++" _GLIBCXX_NORETURN
+ extern "C++" _GLIBCXX_NORETURN __attribute__((__cold__))
void
__glibcxx_assert_fail /* Called when a precondition violation is detected. */
(const char* __file, int __line, const char* __function,
_Error_formatter&
_M_message(_Debug_msg_id __id) const throw ();
- _GLIBCXX_NORETURN void
+ _GLIBCXX_NORETURN __attribute__((__cold__)) void
_M_error() const;
#if !_GLIBCXX_INLINE_VERSION