This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
patch fix issue 1 with "[libstdc++/65033] Give alignment info to libatomic"
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: jwakely at redhat dot com
- Cc: rth at redhat dot com, libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, amacleod at redhat dot com
- Date: Mon, 13 Apr 2015 06:45:35 +0200
- Subject: patch fix issue 1 with "[libstdc++/65033] Give alignment info to libatomic"
- Authentication-results: sourceware.org; auth=none
> 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.
Ever since aligmnent was made sane-ish, 62259.cc has failed for
reasons obvious in the patch. Can I please commit this?
* testsuite/29_atomics/atomic/62259.cc: Assert atomic
alignment is larger-equal, not equal, to default alignment.
Index: libstdc++-v3/testsuite/29_atomics/atomic/62259.cc
===================================================================
--- libstdc++-v3/testsuite/29_atomics/atomic/62259.cc (revision 222036)
+++ libstdc++-v3/testsuite/29_atomics/atomic/62259.cc (working copy)
@@ -33,7 +33,7 @@ struct twoints {
int32_t b;
};
-static_assert( alignof(std::atomic<twoints>) == alignof(int64_t),
+static_assert( alignof(std::atomic<twoints>) >= alignof(int64_t),
"std::atomic not suitably aligned" );
// libstdc++/65147
@@ -44,7 +44,7 @@ struct power_of_two_obj {
std::atomic<power_of_two_obj> obj1;
-static_assert( alignof(obj1) == alignof(int64_t),
+static_assert( alignof(obj1) >= alignof(int64_t),
"std::atomic not suitably aligned" );
struct container_struct {
@@ -54,5 +54,5 @@ struct container_struct {
container_struct obj2;
-static_assert( alignof(obj2.ao) == alignof(int64_t),
+static_assert( alignof(obj2.ao) >= alignof(int64_t),
"std::atomic not suitably aligned" );
brgds, H-P