From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C6863858C5E; Fri, 22 Dec 2023 11:30:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C6863858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703244625; bh=Z0CeTY22hvkgLvcvDuVjLl1IiKCWiggOvRlz5lEogDY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LBDl/mAshjUkF6Hkfj2/ZKCzENWyISfaU+8gj97bjSZBvdlcCPzh6HAPAMO0OMP+G tPdGlujV7zLrMvO9DB4vfOEaP87mfjYhtLWtkeofqBibT4l10jnuYV+Bl6O5wikkkU O+aoC6PV9Jvk8lY6jcp0/nnteXmMPxVHxpGmRUpE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113102] during GIMPLE pass: bitintlower ICE: SIGSEGV with _BitInt() at -O1 or -O2 Date: Fri, 22 Dec 2023 11:30:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization 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=3D113102 --- Comment #4 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:d3defa435e9d04d6ab6585ac184989941c7ad51e commit r14-6803-gd3defa435e9d04d6ab6585ac184989941c7ad51e Author: Jakub Jelinek Date: Fri Dec 22 12:27:05 2023 +0100 lower-bitint: Fix handle_cast ICE [PR113102] My recent change to use m_data[save_data_cnt] instead of m_data[save_data_cnt + 1] when inside of a loop (m_bb is non-NULL) broke the following testcase. When we create a PHI node on the loop using prepare_data_in_out, both m_data[save_data_cnt{, + 1}] are computed and the fix was right, but there are also cases when we in a loop (m_bb non-NULL) emit a nested cast with too few limbs and then just use constant indexes for all accesses - in that case only m_data[save_data_cnt + 1] is initialized and m_data[save_data_cnt] is NULL. In those cases, we want to use the former. 2023-12-22 Jakub Jelinek PR tree-optimization/113102 * gimple-lower-bitint.cc (bitint_large_huge::handle_cast): Only use m_data[save_data_cnt] if it is non-NULL. * gcc.dg/bitint-58.c: New test.=