]> git.ipfire.org Git - thirdparty/gcc.git/commit - libstdc++-v3/ChangeLog
PR libstdc++/90046 fix build failure on epiphany-elf
authorredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Apr 2019 19:58:14 +0000 (19:58 +0000)
committerredi <redi@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Apr 2019 19:58:14 +0000 (19:58 +0000)
commit629a2d18f80c0aa5f54b0bae7e0dd21275e06654
treec6c0720f0c7f85c677449ef59e07871973d6af2e
parent32dfb4d5914a9c48cdeae95ebeea9dce060e8be6
PR libstdc++/90046 fix build failure on epiphany-elf

The epiphany-elf target aligns structs to 8 bytes, which causes the
static_assert(alignof(_Chunk) == 1) to fail.

Instead of requiring _Chunks to be positionable at any alignment, ensure
new buffers are aligned to alignof(_Chunk). Because the buffer size is a
power of two, we know that both the buffer size and sizeof(_Chunk) are
multiples of alignof(_Chunk). So is p is aligned to alignof(_Chunk) then
so is (p + size - sizeof(_Chunk)). So just ensure the new buffer is
aligned to at least alignof(_Chunk), which should already be true
because the caller requests at least alignof(max_align_t).

PR libstdc++/90046
* src/c++17/memory_resource.cc
(monotonic_buffer_resource::_Chunk::allocate): Increase alignment if
needed to allow placing a _Chunk at the end of the buffer.
(monotonic_buffer_resource::_M_new_buffer): Remove static_assert.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270291 138bc75d-0d04-0410-961f-82ee72b054a4
libstdc++-v3/ChangeLog
libstdc++-v3/src/c++17/memory_resource.cc