diff mbox

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

Message ID 201504130445.t3D4jZ24003363@ignucius.se.axis.com
State New
Headers show

Commit Message

Hans-Peter Nilsson April 13, 2015, 4:45 a.m. UTC
>	 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.


brgds, H-P

Comments

Jonathan Wakely April 13, 2015, 11:59 a.m. UTC | #1
On 13/04/15 06:45 +0200, Hans-Peter Nilsson wrote:
>Ever since aligmnent was made sane-ish, 62259.cc has failed for
>reasons obvious in the patch.  Can I please commit this?

Yes, OK for trunk and the gcc-5-branch, thanks.
diff mbox

Patch

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" );