From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7896F3858C20; Wed, 14 Sep 2022 11:26:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7896F3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663154769; bh=lH+F5BBET1ienjKzI0g6EJPN0eP4tA+syJfAtB+kvIY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IlkkPPKTlWM/QgZ2MWUmOvc6sH386nOBsF184PalSD4BDGi39Xr2vJNg/nINdhveo q53dgngeNCUAs2XG/c7TjfWKLw+GbEMvTkER8gj8YjJlhiNkIEkUo9Lw+bK5Qlg/hn gncTTLTP7fIbLUeKjRV9Xs88pGjBxWzSKn0ArqG4= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106654] [C++23] P1774 - Portable assumptions Date: Wed, 14 Sep 2022 11:26:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106654 --- Comment #3 from Richard Biener --- (In reply to Richard Biener from comment #2) > On the C++ frontend side I'd simply handle >=20 > [[assume(expr)]] >=20 > as if 'expr' were in a lambda -> bool with everything captured by value. ... because it seems (ick!) void foo() { int i =3D 0; [[assume(++i =3D=3D 1)]]; if (i !=3D 0) std::abort (); } needs to work. We couldn't let that ++i "escape" to GENERIC/GIMPLE, even when protected with if (.IFN_ASSUME ()) it would create ugly PHIs.=