From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id 8B4F73858D37 for ; Thu, 1 Dec 2022 07:27:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8B4F73858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-x130.google.com with SMTP id d6so1142679lfs.10 for ; Wed, 30 Nov 2022 23:27:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Tt7BR8iH/wLX7j828Cx4fG+bPT4FY+9CpHVSoGC4xss=; b=HPsAs4Xa5U1lpR23pn0yFHQtxMtS+5UeMxdEcXtvflLJoXCk9cP4Yh/BzjROXfoYX5 oycAtM0B4RskLMVD6CFu2akJyVb+3ciwxtGMVYxvUTnHFKZqNA12aIhpD53jrM20sZo0 KZj0QC7pnQj/cO8AdEK0BPnJ6dgNECKrxhr3Hky4XFfYiOlr1Na0CARs3mzjINZ7hi7p aNCZ8lZnp8zytjcP94o3Km33AVfaahb1rCva3eAOAlLGC5mGDJIWN/8aEUiM9OiesXFb NOfPW3HrkclotInucbBC4+18THti306qIsRbui59VmpWktjthvjaU0aWIUfPs9Ua1+mD SqYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc: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=Tt7BR8iH/wLX7j828Cx4fG+bPT4FY+9CpHVSoGC4xss=; b=J8AUtOu8sD0PjXRWSd0K2NOe4faLWf83nXXHZ6/FQI2Xl3g6Y61bzCx26DyDjbAESQ TyCiEngtMN7ggMsKAeJZhDLsr1N3yU3nnPiE1itR/99n9nEsGDyf+m70PDdEHmDHoBZs s0OOerSY6qHr5/QoMDgCCbo+LEFdAdhgsUztIHjWZ9HlYrgh6eYTuanzvD+5x/4g9icc zLzuwWUtPTrgQkr47mAcUZtyrDGUGAR3hC6JQdxCbkva0wqtrpsRi2yobzI5yCVznJMa Qck/nymDyfGRJdeuOCkGY6OPURBFHDqO6vHQap2dAzVrYufiY0NU873yeNPbqgURlhIW ponA== X-Gm-Message-State: ANoB5plzOMya2vIVE4ExQWK2VIAPVOanHz4Nq1xBstQG2SV79s5RSNa6 AV0PVMxXQCCV9y7eWyAqaol/BnaIpPic5KTN6EI= X-Google-Smtp-Source: AA0mqf4ZwWJ8QDkh51XfRn57E1H3VzSC61yEjkgGyT2MI8Y20AuWOpe80Gy4svrOK2zZh9tr4T05l6hrr4V0in5+qXY= X-Received: by 2002:a05:6512:376c:b0:4ad:70c1:de61 with SMTP id z12-20020a056512376c00b004ad70c1de61mr20924972lft.509.1669879624855; Wed, 30 Nov 2022 23:27:04 -0800 (PST) MIME-Version: 1.0 References: <20221130181625.2011166-1-adhemerval.zanella@linaro.org> <20221130232456.GT25951@gate.crashing.org> In-Reply-To: <20221130232456.GT25951@gate.crashing.org> From: Richard Biener Date: Thu, 1 Dec 2022 08:26:52 +0100 Message-ID: Subject: Re: [PATCH] longlong.h: Do no use asm input cast for clang To: Segher Boessenkool Cc: Adhemerval Zanella , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.1 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 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 Thu, Dec 1, 2022 at 12:26 AM Segher Boessenkool wrote: > > Hi! > > On Wed, Nov 30, 2022 at 03:16:25PM -0300, Adhemerval Zanella via Gcc-patches wrote: > > clang by default rejects the input casts with: > > > > error: invalid use of a cast in a inline asm context requiring an > > lvalue: remove the cast or build with -fheinous-gnu-extensions > > > > And even with -fheinous-gnu-extensions clang still throws an warning > > and also states that this option might be removed in the future. > > For gcc the cast are still useful somewhat [1], so just remove it > > clang is used. > > This is one of the things in inline asm that is tightly tied to GCC > internals. You should emulate GCC's behaviour faithfully if you want > to claim you implement the inline asm GNU C extension. I understand that the casts should be no-ops on the asm side (maybe they change the sign) and they are present as type-checking. Can we implement this type-checking in a different (portable) way? I think the macro you use should be named like __asm_output_check_type (..) or so to indicate the intended purpose. Richard. > > --- a/include/ChangeLog > > +++ b/include/ChangeLog > > That should not be part of the patch? Changelog entries should be > verbatim in the message you send. > > The size of this patch already makes clear this is a bad idea, imo. > This code is already hard enough to read. > > > Segher