From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 883613858C00; Wed, 21 Sep 2022 17:49:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 883613858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663782559; bh=mzwfCFZkw6eQwZ4Dm2NyyVj/dXr5e2xO/e95HU3clUg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c6Nhzx6odnmJRSTPdvPiDrtl4WFmm/co6tzoytfvpCD0+TN9OkQCRzQpBsD2faFnZ D7f6ijvXwZ/alMZRz7jh/jd+0J9L/51Br1wuRT8E9uqv9b4XV8kXMudsusVVgkruqv d4Teyiddfyke7QQ37hQ2mA8MLpHQ3QDELVJ2jruE= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106654] [C++23] P1774 - Portable assumptions Date: Wed, 21 Sep 2022 17:49:17 +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: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: assigned_to bug_status attachments.created 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 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gn= u.org Status|NEW |ASSIGNED --- Comment #12 from Jakub Jelinek --- Created attachment 53600 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53600&action=3Dedit gcc13-pr106654.patch Untested patch, with the more difficult cases optimized away during gimplification, so only the most simple assertions are transformed into if (cond); else __builtin_unreachable (); for now, but the FE handling shou= ld be all there, for C++ both as the standard attribute and [[gnu::assume (cond)]= ] or __attribute__((assume (cond))) with the same behavior, for C just the latter two. Similarly, for C++ constant evaluation, it will diagnose only the sim= ple cases (mainly because we'd need to undo all changes to ctx->globals done du= ring evaluation of the assumption). I believe such behavior in both places is standard conforming, but obviously want to work especially on the former (middle-end representation of those) soon.=