From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 728B33858D3C; Mon, 18 Mar 2024 08:16:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 728B33858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710749812; bh=CgDo/PYplcQLEoYGzNIy+yH7d04K302fKpWsNvnMLZk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vQAfB4PtrBIeGVa1aWFEo/eNA6jAujWYfjFl13oOzVERU8Vg1/oBfNtPlBtFtCL5n z0XphMSPAeGTTjRQI5DjcaWqxodPm505vWEByCTIf/5A1teuEf4xc3gQc00//x8KOu hhL1Slqk3cMm4CH4IJ2Gj7hjqhoV0M1Usv9dYD6o= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/114347] wrong constant folding when casting __bf16 to int Date: Mon, 18 Mar 2024 08:16:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 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=3D114347 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #6 from Jakub Jelinek --- You can use -fexcess-precision=3D16 if you don't want treating _Float16 and __bf16 as having excess precision. With excess precision, I think the above behavior is correct. You'd need (int) (__bf16) 257.0bf16 to get 256 even with excess precision.=