From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 69D55E7717D for ; Mon, 9 Dec 2024 13:44:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07AB610E78D; Mon, 9 Dec 2024 13:44:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gwdg.de header.i=@gwdg.de header.b="fda2tSvM"; dkim-atps=neutral Received: from mx-2023-1.gwdg.de (mx-2023-1.gwdg.de [134.76.10.21]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6FF3B10E1DD; Sat, 7 Dec 2024 21:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gwdg.de; s=2023-rsa; h=MIME-Version:Content-Transfer-Encoding:Content-Type:References: In-Reply-To:Date:CC:To:From:Subject:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1er9ita0uF+ZxTC/2Qa8K5Vu+hTMyzU3spem1d6AtRw=; b=fda2tSvMRD3BwYxUoCwB+YEEPo g+VKwjR5vd9U2ZtDlnsITBWsaOKNDt/Q4WX93BbbdZhMPTSrMNV5kOpA3veIHmJH1E8l8U5k5ma8B hlkR5bXEfP4X4KusDw+yLASsDFg1et6G3tN/WP6EsgUMYENyZnqN88qWyhn5l+KrEM/a0eENplXp5 +DnmmEgOaa5dzc9R1VrkDR+MbkDhP5TL5wir/kkNdOLOxy2wjFouXqA9Q+FVzPqvAxP7JMJNEqmUm DfhL1RYpA/0+Y0ShTDWyR8h8AKivDfmXpwzmua74AF+S5m+q3S3/QzcS1uxqtY7zGcqmL3aTIauFJ iwEiM+CQ==; Received: from xmailer.gwdg.de ([134.76.10.29]:49876) by mailer.gwdg.de with esmtp (GWDG Mailer) (envelope-from ) id 1tK206-004QAt-21; Sat, 07 Dec 2024 22:06:06 +0100 Received: from mbx19-fmz-06.um.gwdg.de ([10.108.142.65] helo=email.gwdg.de) by mailer.gwdg.de with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (GWDG Mailer) (envelope-from ) id 1tK206-000BwM-1c; Sat, 07 Dec 2024 22:06:06 +0100 Received: from [192.168.0.221] (10.250.9.200) by MBX19-FMZ-06.um.gwdg.de (10.108.142.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1544.14; Sat, 7 Dec 2024 22:06:04 +0100 Message-ID: <63f538fceadf4e2ba93cdcaae9fab266e5a000ac.camel@gwdg.de> Subject: Re: [PATCH 02/10] compiler.h: add is_const() as a replacement of __is_constexpr() From: Martin Uecker To: David Laight , Linus Torvalds , Vincent Mailhol CC: "w@1wt.eu" , Luc Van Oostenryck , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Yury Norov , "Rasmus Villemoes" , Kees Cook , "Gustavo A. R. Silva" , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Simona Vetter , Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Rikard Falkeborn , "linux-sparse@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "llvm@lists.linux.dev" , "linux-hardening@vger.kernel.org" , "intel-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" , "coresight@lists.linaro.org" , "linux-arm-kernel@lists.infradead.org" Date: Sat, 7 Dec 2024 22:06:04 +0100 In-Reply-To: <20362fe79d494bd59471a9c0f002b2ef@AcuMS.aculab.com> References: <20241203-is_constexpr-refactor-v1-0-4e4cbaecc216@wanadoo.fr> <20241203-is_constexpr-refactor-v1-2-4e4cbaecc216@wanadoo.fr> <1d807c7471b9434aa8807e6e86c964ec@AcuMS.aculab.com> <9ef03cebb4dd406885d8fdf79aaef043@AcuMS.aculab.com> <0f5c07b827c3468c8fa3928a93a98bfa@AcuMS.aculab.com> <6b8c9b942ba6e85a3f1e4eef65a9916333502881.camel@gwdg.de> <20362fe79d494bd59471a9c0f002b2ef@AcuMS.aculab.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4-2 MIME-Version: 1.0 X-Originating-IP: [10.250.9.200] X-ClientProxiedBy: MBX19-SUB-07.um.gwdg.de (10.108.142.72) To MBX19-FMZ-06.um.gwdg.de (10.108.142.65) X-EndpointSecurity-0xde81-EV: v:7.9.17.458, d:out, a:y, w:t, t:5, sv:1733591783, ts:1733605566 X-Virus-Scanned: (clean) by clamav X-Mailman-Approved-At: Mon, 09 Dec 2024 13:43:28 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Am Samstag, dem 07.12.2024 um 21:00 +0000 schrieb David Laight: > From: Martin Uecker > > Sent: 07 December 2024 19:52 ... >=20 > > There exist proposals along those lines for C2Y. > >=20 > > From a more near-term solution, I wonder if making it possible (or > > easier) to return integer constant expressions from statement > > expressions and allowing a restricted form of statement expressions > > at file scope would help? >=20 > It would help a lot if a #define that just used local variables > to avoid arguments being re-expanded and for CSE could still > generate a constant value. > Does need to be a #define - to get token pasting and 'stringify'. > Although you would need something for reporting detected errors, > and builtin compiler support for const_true() for the detection > itself. We are super close: https://godbolt.org/z/Tarq89bha (if we ignore the grotesque hacks to get there, but this would go away if the compiler does it internally) Martin