From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D09213856975; Wed, 26 Jul 2023 13:04:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D09213856975 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1690376654; bh=nD0y/R5LrCMZ4y78B48SuPs4CDZK/JDZAGLVXBd5lqs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=JyIT0ycoDGVaLiQbhJNfcM+gMxkdmsEDAu4QJk4V0m1YPazb+UE/0fy5njGQs4vQN PHEpGOZK5368ekMuu3kMAdz5Tq21ngRaHO0uhl0+ugy7ILDkaZLzNOzmgCKFgy/Dk5 l1pUoYwba3iV1kes3EDiOUo5eBgFQH+M0jpjt0i0= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/102989] Implement C2x's n2763 (_BitInt) Date: Wed, 26 Jul 2023 13:04: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: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement 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: attachments.isobsolete 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=3D102989 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #55628|0 |1 is obsolete| | --- Comment #89 from Jakub Jelinek --- Created attachment 55637 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55637&action=3Dedit gcc14-bitint-wip.patch Updated patch with -fsanitize=3Dundefined _BitInt support. Some of the runtime messages are inaccurate and some are totally incorrect,= but I'm afraid I can't do much until libubsan adds support for _BitInt, which I= 've requested in https://github.com/llvm/llvm-project/issues/64100 For +-* overflow the messages look good until (inclusive) _BitInt(128) on 64-bit arches (or _BitInt(64) on 32-bit ones), larger print inste= ad of numbers and think it is unsigned integer overflow rather than signed (bu= t I think that is better than what clang does when stuff just crashes with what= it emits or prints random numbers). For / overflow, again up to _BitInt(128) it works fine, otherwise prints division by zero rather than minimum / -1. For shifts with non-mode precis= ion _BitInts, even small ones, there are various inaccuracies, because libubsan think the mode precision is the precision of the type.=