diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2020-09-21 14:28:58 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2020-09-21 14:28:58 +0100 |
commit | f10ed928e2f8ecc2c859abff8f2f9296b11b8d95 (patch) | |
tree | 0f741066ee5f536a96dd61d3f28e9a9ac83498df /libgo/go | |
parent | 5187b01a4fcbea82f52798240595a32ddf7e0fe5 (diff) | |
download | gcc-f10ed928e2f8ecc2c859abff8f2f9296b11b8d95.zip gcc-f10ed928e2f8ecc2c859abff8f2f9296b11b8d95.tar.gz gcc-f10ed928e2f8ecc2c859abff8f2f9296b11b8d95.tar.bz2 |
libstdc++: Make std::assume_aligned a constexpr function [PR 97132]
The cast from void* to T* in std::assume_aligned is not valid in a
constexpr function. The optimization hint is redundant during constant
evaluation anyway (the compiler can see the object and knows its
alignment). Simply return the original pointer without applying the
__builtin_assume_aligned hint to it when doing constant evaluation.
This change also removes the preprocessor branch that works around
uintptr_t not being available. We already assume that type is present
elsewhere in the library.
libstdc++-v3/ChangeLog:
PR libstdc++/97132
* include/bits/align.h (align) [!_GLIBCXX_USE_C99_STDINT_TR1]:
Remove unused code.
(assume_aligned): Do not use __builtin_assume_aligned during
constant evaluation.
* testsuite/20_util/assume_aligned/1.cc: Improve test.
* testsuite/20_util/assume_aligned/97132.cc: New test.
Diffstat (limited to 'libgo/go')
0 files changed, 0 insertions, 0 deletions