This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [libstdc++/65033] Give alignment info to libatomic
- From: Hans-Peter Nilsson <hp at bitrange dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>
- Cc: Richard Henderson <rth at redhat dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Andrew MacLeod <amacleod at redhat dot com>
- Date: Mon, 6 Apr 2015 18:59:07 -0400 (EDT)
- Subject: Re: [libstdc++/65033] Give alignment info to libatomic
- Authentication-results: sourceware.org; auth=none
- References: <54DD19B7 dot 6060401 at redhat dot com> <20150218121512 dot GI3360 at redhat dot com> <20150325162244 dot GF9755 at redhat dot com> <5513003D dot 3040107 at redhat dot com> <20150325184913 dot GH9755 at redhat dot com> <551306C1 dot 6060702 at redhat dot com> <20150326132147 dot GL9755 at redhat dot com>
On Thu, 26 Mar 2015, Jonathan Wakely wrote:
--- /dev/null
+++ b/libstdc++-v3/testsuite/29_atomics/atomic/62259.cc
+static_assert(alignof(obj1) == alignof(int64_t),
+ "std::atomic not suitably aligned" );
+
+struct container_struct {
+ char c[1];
+ std::atomic<power_of_two_obj> ao;
+};
+
+container_struct obj2;
+
+static_assert( alignof(obj2.ao) == alignof(int64_t),
+ "std::atomic not suitably aligned" );
I'd suggest replacing == with >= or compare with
alignof(atomic_int64_t) (figuratively).
brgds, H-P