[libstdc++/65033] Give alignment info to libatomic
Jonathan Wakely
jwakely@redhat.com
Tue Mar 31 13:41:00 GMT 2015
On 26/03/15 13:21 +0000, Jonathan Wakely wrote:
>This includes your fix to avoid decreasing alignment, but I didn't add
>a test for that as I couldn't make it fail on any of the targets I
>test on.
>commit f796769ad20c0353490b9f1a7e019e2f0c1771fb
>Author: Jonathan Wakely <jwakely@redhat.com>
>Date: Wed Sep 3 15:39:53 2014 +0100
>
> PR libstdc++/62259
> PR libstdc++/65147
> * include/std/atomic (atomic<T>): Increase alignment for types with
> the same size as one of the integral types.
> * testsuite/29_atomics/atomic/60695.cc: Adjust dg-error line number.
> * testsuite/29_atomics/atomic/62259.cc: New.
My patch was not sufficient to fix 65147, because I didn't increase
the alignment of the std::atomic<integral type> specializations, and
std::atomic<16-byte type> is only aligned correctly if __int128 is
supported, which isn't true on x86 and other 32-bit targets.
This is the best I've come up with, does anyone have any better ideas
than the #else branch to hardcode alignment of 16-byte types to 16?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 3922 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150331/698d2271/attachment.bin>
More information about the Gcc-patches
mailing list