diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-11-26 21:34:17 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-11-26 22:28:48 +0000 |
commit | 33adfd0d42e54c809b0c53212abe66e8c874b2f8 (patch) | |
tree | f150053a0dfbd140fa6c9149d5fdea1d6b4f5e18 /libgcc | |
parent | 76c6be48b7841524974754f8ea7533b82c7de77e (diff) | |
download | gcc-33adfd0d42e54c809b0c53212abe66e8c874b2f8.zip gcc-33adfd0d42e54c809b0c53212abe66e8c874b2f8.tar.gz gcc-33adfd0d42e54c809b0c53212abe66e8c874b2f8.tar.bz2 |
libstdc++: Fix trivial relocation for constexpr std::vector
When implementing constexpr std::vector I added a check for constant
evaluation in vector::_S_use_relocate(), so that we would not try to relocate
trivial objects by using memmove. But I put it in the constexpr function
that decides whether to relocate or not, and calls to that function are
always constant evaluated. This had the effect of disabling relocation
entirely, even in non-constexpr vectors.
This removes the check in _S_use_relocate() and modifies the actual
relocation algorithm, __relocate_a_1, to use the non-trivial
implementation instead of memmove when called during constant
evaluation.
libstdc++-v3/ChangeLog:
* include/bits/stl_uninitialized.h (__relocate_a_1): Do not use
memmove during constant evaluation.
* include/bits/stl_vector.h (vector::_S_use_relocate()): Do not
check is_constant_evaluated in always-constexpr function.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions