From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x830.google.com (mail-qt1-x830.google.com [IPv6:2607:f8b0:4864:20::830]) by sourceware.org (Postfix) with ESMTPS id 0CD6D3858D1E for ; Sat, 13 Jan 2024 17:13:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0CD6D3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0CD6D3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::830 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705165990; cv=none; b=SkAE2h6tAhJzpatmjO7MhKtomuzty6fchUn7W4LTGDC2cX7c7ggOzgHfrsLVWsA9y5ODj/m+zT7TU1N4gJV5I0dXu1ah8CxbNjOyIRgks5iFUERF7f8PC3Clz1vkfcW+XNvAdgOeG+a1LFL23PnJIaFdC1yt8Tvrh6pG+90rEj8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705165990; c=relaxed/simple; bh=oBBczdYxA4ing1wwY+ATIwXNjfACmRITOY/7N+CdURU=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=n2nS93uws6WIi7bgjQ2eQKpHbt2HM+CpkyPwqE4BTS2l+zAXISduyLA44DzCltj0dUR7PPF4mp7QY2u45cKKntqXdaPK56H9KofqhhDK+zZMVS9HVGapMIck2hF1B4oKQQWhd1OzxuuVBz/3gKTPX7hVG3DhoMMYj+rvlVBoMIQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-qt1-x830.google.com with SMTP id d75a77b69052e-427ca22a680so50870291cf.3 for ; Sat, 13 Jan 2024 09:13:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705165987; x=1705770787; darn=gcc.gnu.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=oBBczdYxA4ing1wwY+ATIwXNjfACmRITOY/7N+CdURU=; b=h9wWHr3nmyJaKPxXbZx25IlrPhUNkpbc/e8YZJxbSPTurGjjyruh5KEgfL9/NKogFK gzVfy1E1AcZoPxYxPxlbyH2sXrEDW81l9sDL5YryIss0QxxOwpzF/lpE9rvstaJPT04J jA1YH2ot1ttBwGxn/7O8qB3Q8Hargegy3UGjOAXpBIVf34AmJhEki2i06IAsiDn8+g63 C63fMZgEUAxZeyFYNnBIQsXTetNZC1REHtf+pt6qJ/hpD169nYnaORDgd//bZvbb1POy hQugT/e0+sSRrcqDSFtNhPop9MLgr/vPj09MMCcOp7/WG7kres4gaf3c6StzkI2bxRzF 8NzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705165987; x=1705770787; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oBBczdYxA4ing1wwY+ATIwXNjfACmRITOY/7N+CdURU=; b=GlkgoTkPx8XOcgUrTlX2q8knhv0kYrwzCwlQ4WQ57mvlMoDoXR5dEioG558p5mYsBG Px26pTBtatPX4qPr/2K0YtGpAtnV6BcSUrBCfFNcZHcUslDcvDtr9zUxUb/whr3SXqoe I8ROCql0AWU+wiVDAwoot9uVqMx0ljD2C0TsdJG7uiVFubZl0vR/c3pHIDa5hSWabYTz puDQXU+az5ZjUdfGhmFFNTNIlpgAbaw5Hpz7D8eSZWKBkvGjuVOsiC70wJgc1rhQfFaw gw8z8UMXY3JRt61T8Ez6Vq0J7lPDywUtfEGYtw9nXjZur7/lzua6k0tcwvRC8a9LlCy8 gZiw== X-Gm-Message-State: AOJu0YxmJRk5V5RixrnsZFmnKMb6EtoEHDzVe7pyOX8zKqiaViVv8LyN n7LxPYTJDv03YVwQrUT6hQlrHNcPIQXZ1kjCZbcK+9aTrsUmQg== X-Google-Smtp-Source: AGHT+IF+kuuqyeatqUyukNSZIMaU/Gj/+z+6wM0GS3yJAoI8Dh4S+CqzqAX94A8KMFndIQ9uK/546chNRssLv4nm3O8= X-Received: by 2002:a05:622a:1b8d:b0:429:af93:4e7f with SMTP id bp13-20020a05622a1b8d00b00429af934e7fmr4359012qtb.64.1705165986808; Sat, 13 Jan 2024 09:13:06 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dan Klishch Date: Sat, 13 Jan 2024 12:12:49 -0500 Message-ID: Subject: Re: [[gcc_struct]] potential clang compatibility concerns To: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Sat, Dec 2, 2023 at 4:50=E2=80=AFPM Dan Klishch wr= ote: > > Hi, > > In the discussion of LLVM's PR adding `[[gnu::gcc_struct]]` support to Cl= ang > (https://github.com/llvm/llvm-project/pull/71148), maintainers asked > me to make sure that whatever > is done there, makes sense for GCC too. > > To summarize the long discussion on GitHub, GCC supports gcc_struct, > ms_struct, and > `-m{no-,}ms-bitfields` only on X86, while Clang currently supports ms_str= uct and > `-m{no-,}ms-bitfields` on all targets with Itanium C++ ABI. > Correspondingly, my PR adds support for > gcc_struct for all targets with the Itanium C++ ABI and paves the road > for gcc_struct and ms_struct > support on targets with Microsoft C++ ABI (mainly, > x86_64-pc-windows-msvc). There, I envision > `ms_struct` to be a no-op (just like `gcc_struct` is usually a no-op > with Itanium C++ ABI) and > `gcc_struct` to change layout of C structs (or fields within C++ > classes) to be compatible with the > GenericItanium C++ ABI. > > As far as I can tell, the maintainer's question is "in a theoretical > event GCC starts supporting > Microsoft C++ ABI, would it make sense to implement gcc_struct and > ms_struct on it just like I > propose to?". Turns out that I wasn't quite right here about what John (@rjmccall) asked. Quoting him: "Right, I'd just like to make sure that we're not deepening a divergence here. It would be good to get agreement from the GCC devs that they think ms_struct probably ought to do something on e.g. ARM MinGW targets and that they consider this a bug (in a feature that they may not really support, which is fine). But if they think we're wrong and that this really should only have effect on x86, I would like to know that". I hope ARM MinGW target for GCC is much less far-fetched and I would actually get a reply from someone. > > Thanks, > Dan Klishch