From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30240 invoked by alias); 23 Aug 2019 11:17:40 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 30228 invoked by uid 89); 23 Aug 2019 11:17:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=idsandoegooglemailcom, idsandoe@googlemail.com, jwakelygccgmailcom, jwakely.gcc@gmail.com X-HELO: mail-wr1-f68.google.com Received: from mail-wr1-f68.google.com (HELO mail-wr1-f68.google.com) (209.85.221.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Aug 2019 11:17:38 +0000 Received: by mail-wr1-f68.google.com with SMTP id y8so8264081wrn.10 for ; Fri, 23 Aug 2019 04:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=bfIyu0DlC/JcZB2rcto4YNDUhhiLS1Jf9NJCsP/rx+E=; b=ajq1Ua+NGpKenqSZ+lqAEHj3Wl8esMos0J8YokXgcPZygbWgaDeWJ7QEc4pfiiQwC1 3mFqdOmRJ9G5yWci/qeCOhnuP9zR6SO28RJe9HLh5QLwy7cxp4yy7n3IaqaQsdBqZb8Q yEpiudvl37bIkEU9Dsybytxe7ks0F2jCesv0/1EOWjUZzYWtsymg86DLr8OBojVzIETP pJq3txLsxKy5K2dOaxIkhDBnrKSTuIipSx6G2aBHw2ES4LpVPpC075wQFqT8dFU+HyIh hECbuRFos3jDoahbhLeOEsBc2npyfnliHjoQEH4Hj5XamkDaORC5F4MSvZX9luEfVRHC f9Dw== MIME-Version: 1.0 References: <4B203FA6-1E0F-4DA2-B86E-D51A0105138E@googlemail.com> <1B1B7543-E830-43C6-B996-7FE51E4540E1@googlemail.com> In-Reply-To: <1B1B7543-E830-43C6-B996-7FE51E4540E1@googlemail.com> From: Jonathan Wakely Date: Fri, 23 Aug 2019 11:17:00 -0000 Message-ID: Subject: Re: gcc vs clang for non-power-2 atomic structures To: Iain Sandoe Cc: Jim Wilson , "gcc@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00196.txt.bz2 On Fri, 23 Aug 2019, 11:13 Iain Sandoe, wrote: > > > > On 23 Aug 2019, at 10:35, Jonathan Wakely wrote: > > > > On Fri, 23 Aug 2019 at 08:21, Iain Sandoe wro= te: > >> > >> Hi Jim, > >> > >>> On 23 Aug 2019, at 00:56, Jim Wilson wrote: > >>> > >>> We got a change request for the RISC-V psABI to define the atomic > >>> structure size and alignment. And looking at this, it turned out that > >>> gcc and clang are implementing this differently. Consider this > >>> testcase > >>> > >>> rohan:2274$ cat tmp.c > >>> #include > >>> struct s { int a; int b; int c;}; > >>> int > >>> main(void) > >>> { > >>> printf("size=3D%ld align=3D%ld\n", sizeof (struct s), _Alignof(struct= s)); > >>> printf("size=3D%ld align=3D%ld\n", sizeof (_Atomic (struct s)), > >>> _Alignof(_Atomic (struct s))); > >>> return 0; > >>> } > >>> rohan:2275$ gcc tmp.c > >>> rohan:2276$ ./a.out > >>> size=3D12 align=3D4 > >>> size=3D12 align=3D4 > >>> rohan:2277$ clang tmp.c > >>> rohan:2278$ ./a.out > >>> size=3D12 align=3D4 > >>> size=3D16 align=3D16 > >>> rohan:2279$ > >>> > >>> This is with an x86 compiler. > >> > >> A search for _Atomic in the latest (x86_64) psABI document shows no re= sults. > > > > See https://groups.google.com/forum/#!topic/ia32-abi/Tlu6Hs-ohPY and > > the various GCC bugs linked to from that thread. > > > > This is a big can of worms, and GCC needs fixing (but probably not > > until the ABI group decide something). > > I agree about the size of the can of worms. > However, there doesn=E2=80=99t seem to be any actual issue filed on: > https://github.com/hjl-tools/x86-psABI > > Would it help if someone did? Is that for IA-32 as well, or only x86-64 and x32? I thought the Google group was the right place for IA-32 issues, and that would then get picked up by the x86-64 psABI too. But I don't know. It would be helpful if these things weren't spread around over so many different locations with no actual fixes happening. Just to confuse me further, the wiki at that GitHub repo says to go to gitl= ab! "All x86-64 psABI changes should be sent to https://gitlab.com/x86-psABIs/x86-64-ABI." It feels like nobody cares about fixing this.