From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5C1B9382C62B; Sat, 17 Sep 2022 12:12:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C1B9382C62B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663416763; bh=1JbECNFhiGLFYw60x+r0LBjHJt2IK/yFOTGcDhF5v48=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QU2atdhfQ3olA9pZoLvivkaH3wSt9oymEdEakNiTgaKL4UixQMfr5BydhACDTu8TY OOvTkWC4YpeYxgHSLDHnDSjf5PF6dM1TmZ2U3qcmzMx7YAAdGE5pPdtqZ4c8q/7165 HMQRNQxo/hlEfg55b3GGLd3nVG8IAHbB6ulIWhoM= From: "aldyh at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106654] [C++23] P1774 - Portable assumptions Date: Sat, 17 Sep 2022 12:12:42 +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: aldyh at gcc dot gnu.org X-Bugzilla-Status: NEW 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 #9 from Aldy Hernandez --- (In reply to Jason Merrill from comment #8) > (In reply to Aldy Hernandez from comment #7) > > Silly question, why can't you expand the [[assume]] construct into: > >=20 > > if (x > 5) > > __builtin_unreachable (); > >=20 > > ...like we always have. Then no changes are needed to ranger :). Or d= oes > > this have to do with the whole side-effect thing? >=20 > Exactly. For expressions with no side-effects, we can do that. For, say= , a > call to a non-const function, we need to avoid actually emitting the call. So...could we keep doing what we're doing for non side-effect code, and onl= y do the outline function for side-effect stuff? Or is that too much to ask? But wait a minute, is calling a non-const function from [[assume]] even allowed?=