From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17515 invoked by alias); 3 Apr 2015 03:04:25 -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 17497 invoked by uid 89); 3 Apr 2015 03:04:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: arjuna.pair.com Received: from arjuna.pair.com (HELO arjuna.pair.com) (209.68.5.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 03 Apr 2015 03:04:23 +0000 Received: by arjuna.pair.com (Postfix, from userid 3006) id EB0CB8A22F; Thu, 2 Apr 2015 23:04:20 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id EA97B8A220; Thu, 2 Apr 2015 23:04:20 -0400 (EDT) Date: Fri, 03 Apr 2015 03:04:00 -0000 From: Hans-Peter Nilsson To: Jonathan Wakely cc: Richard Henderson , libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org, Andrew MacLeod Subject: Re: [libstdc++/65033] Give alignment info to libatomic In-Reply-To: <20150325162244.GF9755@redhat.com> Message-ID: References: <54DD19B7.6060401@redhat.com> <20150218121512.GI3360@redhat.com> <20150325162244.GF9755@redhat.com> User-Agent: Alpine 2.02 (BSF 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00101.txt.bz2 On Wed, 25 Mar 2015, Jonathan Wakely wrote: > I've convinced myself that Richard's patch is correct in all cases, > but I think we also want this patch, to fix PR62259 and PR65147. > > For the generic std::atomic (i.e. not the integral or pointer > specializations) we should increase the alignment of atomic types that > have the same size as one of the standard integral types. This should > be consistent with what the C front end does for _Atomic, based on > what Joseph told me on IRC: Wrong. > jwakely: _Atomic aligns 1/2/4/8/16-byte types the same as > integer types of that size. No it doesn't! It's "same or higher as". > (Which may not be alignment = size, depending on the > architecture.) > > Ideally we'd use an attribute like Andrew describes at > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62259#c4 but that's not > going to happen for GCC 5, so this just looks for an integral type of > the same size and uses its alignment. > > Tested x86_64-linux, powerpc64le-linux. > > I'll wait for RM approval for this and Richard's patch (which is OK > from a libstdc++ perspective). > brgds, H-P