From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: emacs-26 9e59de9: Use GCALIGNED properly for GCC Date: Fri, 10 Nov 2017 09:58:03 -0800 Organization: UCLA Computer Science Department Message-ID: <8d9c169a-5f58-6958-9fca-4c68fa547ba3@cs.ucla.edu> References: <20171109031206.7056.28312@vcs0.savannah.gnu.org> <20171109031208.D2CAF2033E@vcs0.savannah.gnu.org> <5A0550FE.2030703@gmx.at> <83zi7upnfo.fsf@gnu.org> <4ee60712-789e-f160-52a9-4e24a9733a11@cs.ucla.edu> <83shdmpiah.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1510336731 22313 195.159.176.226 (10 Nov 2017 17:58:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Nov 2017 17:58:51 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 10 18:58:47 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eDDZn-0005aG-By for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2017 18:58:47 +0100 Original-Received: from localhost ([::1]:42905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDDZu-0003rl-Ol for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2017 12:58:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDDZN-0003rd-Ka for emacs-devel@gnu.org; Fri, 10 Nov 2017 12:58:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDDZJ-0000NW-K5 for emacs-devel@gnu.org; Fri, 10 Nov 2017 12:58:21 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:42422) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eDDZJ-0000Mh-Dv for emacs-devel@gnu.org; Fri, 10 Nov 2017 12:58:17 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 93DBF16109F; Fri, 10 Nov 2017 09:58:14 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 5nBxBnKTSNFz; Fri, 10 Nov 2017 09:58:12 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id CD3A21610A0; Fri, 10 Nov 2017 09:58:12 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Shq5IaqZUxsM; Fri, 10 Nov 2017 09:58:12 -0800 (PST) Original-Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 9377F16109F; Fri, 10 Nov 2017 09:58:12 -0800 (PST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220031 Archived-At: Stefan Monnier wrote: >> union gcaligned_foo { struct foo s; int64_t gcaligned; }; >=20 > Are int64_t necessarily aligned on multiples of 8 on 32bit platforms? No, unfortunately. >> IOW, should we rely on alignas? There could be dragons there too, no? >=20 > FWIW, for the dummy alignment thingy I wouldn't use `char` (I wouldn't = be > surprised to see errors in compilers when asking to align on multiples > of N for objects smaller than N), so maybe >=20 > #define gc_aligned(typename) \ > union { typename s; int64_t alignas (GCALIGNMENT) dummy; }; That does not work either, alas, as C11 says 'alignas (8)' is an error wh= en the=20 natural alignment of the object is less than 8. This is one of the proble= ms that=20 we have encountered in earlier attempts to fix this bug. 'char alignas (8= )'=20 avoids this problem. If we run into a platform where alignas (8) does not work either natively= or via=20 Gnulib emulation, the patch I'm working on has a 'verify' check that shou= ld=20 result in a build failure. Although I have some ideas for fixing the situ= ation=20 if it arises, they would add some complexity (and would depend on the det= ails of=20 any problematic hosts), and I'd rather avoid this if possible.