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 00:26:19 -0800 Organization: UCLA Computer Science Department Message-ID: <4ee60712-789e-f160-52a9-4e24a9733a11@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> 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 1510302400 25908 195.159.176.226 (10 Nov 2017 08:26:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 10 Nov 2017 08:26:40 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 Cc: rgm@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii , martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 10 09:26:36 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 1eD4e2-0006TP-0o for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2017 09:26:34 +0100 Original-Received: from localhost ([::1]:40624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eD4e9-0006Pr-GV for ged-emacs-devel@m.gmane.org; Fri, 10 Nov 2017 03:26:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50067) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eD4e2-0006PV-Aj for emacs-devel@gnu.org; Fri, 10 Nov 2017 03:26:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eD4e1-0005jb-IV for emacs-devel@gnu.org; Fri, 10 Nov 2017 03:26:34 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:37576) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eD4dw-0005aj-Ux; Fri, 10 Nov 2017 03:26:29 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 800EF160F8E; Fri, 10 Nov 2017 00:26:24 -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 w-PgBqQNFwKU; Fri, 10 Nov 2017 00:26:23 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4B038161076; Fri, 10 Nov 2017 00:26:23 -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 chC1FEKh4VMe; Fri, 10 Nov 2017 00:26:23 -0800 (PST) Original-Received: from [192.168.1.9] (unknown [47.154.30.119]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 04B51160F8E; Fri, 10 Nov 2017 00:26:23 -0800 (PST) In-Reply-To: <83zi7upnfo.fsf@gnu.org> 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:220021 Archived-At: Eli Zaretskii wrote: > Paul, maybe we should simply go back a few notches and not mark > main_thread as GCALIGNED, except on that single platform which needed > it (i.e. via #ifdef)? Then we could return all the other symbols to > their previous syntax. >=20 > Or maybe we should move GCALIGNED to yet another position, like at the > beginning or the end of the whole construct. Like this: >=20 > GCALIGNED struct foo FOO; > or > struct foo FOO GCALIGNED; >=20 > Not sure what else can we do, but this seems to be an exceptionally > fragile feature, at least with GCC 7 that many people are using. I've investigated this further, and neither solution is likely to work. I= t is=20 merely the luck of the draw that we have seen the bug only on that platfo= rm so=20 far, and a similar bug is likely to occur on other platforms. Neither GCA= LIGNED=20 syntax works in general (see GCC bug 82914) and we've seen examples of fa= ilures=20 with either syntax. I have thought of a solution that fixes the problem by dropping use of GC= ALIGNED=20 and instead using classic C unions along with 'char alignas (8)'. The ide= a is to=20 gcalign a 'struct foo' this way: union gcaligned_foo { struct foo s; char alignas (8) gcaligned; }; Something like this should work on all platforms that Emacs ports to. I p= lan to=20 work on a first cut tomorrow.