patch fix issue 1 with "[libstdc++/65033] Give alignment info to libatomic"

Hans-Peter Nilsson hans-peter.nilsson@axis.com
Mon Apr 13 04:45:00 GMT 2015


>	 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



More information about the Libstdc++ mailing list