From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CD130385700F; Fri, 1 Dec 2023 09:56:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD130385700F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701424595; bh=RHHZvgr1aI71Go+7lYDqCeqiolNifd15XG9cqoE1XaE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NNCxzY5v2MlS/n5lPrRFxyhduB/pac634kfvYzacrqvCyRJUa/1KrH/1T2lTW3edU ku9B581QuE8eBQRFsQpq1JTnA+WTfHt+JfQ2RpaJPyqXzmRyBWUrJMN6fx/72rzkP/ nKW1CRL2wx/n6neqBKlEppwTMOvbgZlYmh/4E7pU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/112771] during GIMPLE pass: bitintlower0 ICE: in build_bitint_type, at tree.cc:7178 with _BitInt(65535) and division by zero Date: Fri, 01 Dec 2023 09:56:34 +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: 14.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 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=3D112771 --- Comment #2 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:9bfebcb1b7ae4e7160644f2104424d6bab4a23f7 commit r14-6050-g9bfebcb1b7ae4e7160644f2104424d6bab4a23f7 Author: Jakub Jelinek Date: Fri Dec 1 10:55:49 2023 +0100 lower-bitint: Fix up handle_operand_addr for 0 constants [PR112771] handle_operand_addr for INTEGER_CSTs uses wi::min_precision (UNSIGNED for non-negative constants, SIGNED for negative ones) and from that computes mp as minimum number of limbs which can represent that value, and in some cases creates a test BITINT_TYPE with that precision to categorize it and decide based on that what types to use on the constant emitted into memory. For the actual precisions (what will be passed to libgcc) it actually already uses MAX/MIN to adjust the corner cases: *prec =3D MAX (min_prec, 1); ... *prec =3D MIN ((int) -min_prec, -2); but for integer_zerop min_prec will be 0, mp =3D CEIL (min_prec, limb_prec) * limb_prec; will be also 0 and we ICE trying to build unsigned BITINT_TYPE with 0 precision. Fixed thusly by noting even 0 has to be encoded at least as one limb. 2023-12-01 Jakub Jelinek PR middle-end/112771 * gimple-lower-bitint.cc (bitint_large_huge::handle_operand_add= r): Use mp =3D 1 if it is zero. * gcc.dg/bitint-44.c: New test.=