From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 22E923AAA067; Fri, 16 Sep 2022 09:20:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22E923AAA067 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663320011; bh=biiONzZLimL+AdSdWhAo7XBdAkQT3Vl/1RUr/o74AjM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=T1tFKnHFKqiSa9IqD2AukJi3EgRhIZlyj97KuKKm5U4+HRU1tFgZN5eSqEYW8n7wY T56e/8p2oSgY8mW8RDvCJW1qBMvK5osD/qsrqwUwFcwGrOWX/woaXT0K5Unby8SGsH ggZ734Jw7unHxMXZER2COL6kcCKMyosagCrVnOv0= From: "pilarlatiesa at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106654] [C++23] P1774 - Portable assumptions Date: Fri, 16 Sep 2022 09:20:10 +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: pilarlatiesa at gmail dot com 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: cc 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 Pilar Latiesa changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pilarlatiesa at gmail dot = com --- Comment #5 from Pilar Latiesa --- (In reply to Jakub Jelinek from comment #4) > Note, I think for [[assume(i =3D=3D j)]]; we can just emit if (i =3D=3D j= ) ; else > __builtin_unreachable (); It would be great if the attribute were somewhat cleverer than that.=20 For example: double my_sqrt(double const d) { [[assume(d >=3D 0.0)]]; return std::sqrt(d); } or even: double my_sqrt(double const d) { [[assume(std::isfinite(std::sqrt(d)))]] return std::sqrt(d); }=