diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2024-11-17 01:21:04 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@ucw.cz> | 2024-11-17 01:23:53 +0100 |
commit | aac5c57ee167230cea466064951daf06e42197b9 (patch) | |
tree | 539c1ee2f32e3c2b75f97ec3acdc9d2194735d90 /libphobos/README.gcc | |
parent | a649efea00992ea6eba550e5d575fbafb5b290dd (diff) | |
download | gcc-aac5c57ee167230cea466064951daf06e42197b9.zip gcc-aac5c57ee167230cea466064951daf06e42197b9.tar.gz gcc-aac5c57ee167230cea466064951daf06e42197b9.tar.bz2 |
Add __builtion_unreachable to vector::size(), vector::capacity()
This patch makes it clear that vector sizes and capacities are not
negative. With recent change to ipa-fnsummary this should not affect
inlining and improves codegen of some vector manipulation functions.
I tested clang build. Looking for throw_bad calls there are only 3
called considerably often (bad_allloc, bad_array_new_length and
function_callv).
The patch seems to reduce bad_alloc and bad_array_new_length calls
considerably:
bad_alloc 380->147
bad_array_new_length 832->128
libstdc++-v3/ChangeLog:
PR tree-optimization/109442
* include/bits/stl_vector.h: (vector::size(),
vector::capacity()): Add __builtin_unreachable call to announce
that size and capacity are non-negative.
gcc/testsuite/ChangeLog:
PR tree-optimization/109442
* g++.dg/tree-ssa/pr109442.C: New test.
Diffstat (limited to 'libphobos/README.gcc')
0 files changed, 0 insertions, 0 deletions