From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116735 invoked by alias); 25 Mar 2015 19:04:37 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 116717 invoked by uid 89); 25 Mar 2015 19:04:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 25 Mar 2015 19:04:36 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 085D5C2FE1; Wed, 25 Mar 2015 19:04:35 +0000 (UTC) Received: from anchor.twiddle.net (vpn-237-53.phx2.redhat.com [10.3.237.53]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2PJ4YAA000626; Wed, 25 Mar 2015 15:04:34 -0400 Message-ID: <551306C1.6060702@redhat.com> Date: Wed, 25 Mar 2015 19:04:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Jonathan Wakely CC: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org, Andrew MacLeod Subject: Re: [libstdc++/65033] Give alignment info to libatomic References: <54DD19B7.6060401@redhat.com> <20150218121512.GI3360@redhat.com> <20150325162244.GF9755@redhat.com> <5513003D.3040107@redhat.com> <20150325184913.GH9755@redhat.com> In-Reply-To: <20150325184913.GH9755@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg01318.txt.bz2 On 03/25/2015 11:49 AM, Jonathan Wakely wrote: > On 25/03/15 11:36 -0700, Richard Henderson wrote: >> On 03/25/2015 09:22 AM, Jonathan Wakely wrote: > On 25/03/15 11:39 -0700, Richard Henderson wrote: >> On 03/25/2015 09:22 AM, Jonathan Wakely wrote: >>> +static_assert( alignof(std::atomic) > alignof(int), >>> + "std::atomic not suitably aligned" ); >> >> This is only true if int64_t has alignment larger than int32_t, >> which is unfortunately not always the case. > > Huh, didn't realise that. I could change the tests to check it's > alignof(std::int64_t) as the next assertion does, but is it safe to > assume that struct twoints { int a; int b; } is exactly 64 bits > everywhere? Certainly not. But if you're going to explicitly use int64_t elsewhere, you might as well explicitly use int32_t as well. Then I believe you can reasonably assert alignof(twoint32) == alignof(int64_t) r~