diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-04-19 10:20:04 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-04-19 10:20:04 -0400 |
commit | cd3964ebd3e94ed0df4ecaadb7fd34e991cec753 (patch) | |
tree | 00c3cf8f67d2df5ea7a7d20968921cc85cbf5d4e /libgo | |
parent | fdb3f82fb324c3ddd7464d11c8ea60a98f486a0e (diff) | |
download | gcc-cd3964ebd3e94ed0df4ecaadb7fd34e991cec753.zip gcc-cd3964ebd3e94ed0df4ecaadb7fd34e991cec753.tar.gz gcc-cd3964ebd3e94ed0df4ecaadb7fd34e991cec753.tar.bz2 |
libstdc++: Stop defining _GLIBCXX_ASSERTIONS in floating_to_chars.cc
Assertions were originally enabled in the compiled-in floating-point
std::to_chars implementation to help shake out any bugs, but they
apparently impose a significant performance penalty, most notably for
the hex formatting which is around 25% slower with assertions enabled.
This seems too high a cost for unconditionally enabling them.
The newly added calls to __builtin_unreachable work around the compiler
no longer knowing that the set of valid values of 'fmt' is limited (which
was previously upheld by an assert).
libstdc++-v3/ChangeLog:
* src/c++17/floating_to_chars.cc (_GLIBCXX_ASSERTIONS): Don't
define.
(__floating_to_chars_shortest): Add __builtin_unreachable calls to
squelch false-positive -Wmaybe-uninitialized and -Wreturn-type
warnings.
(__floating_to_chars_precision): Likewise.
Diffstat (limited to 'libgo')
0 files changed, 0 insertions, 0 deletions