From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C0D863858C5E; Mon, 4 Dec 2023 14:32:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0D863858C5E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701700368; bh=gZ0W6mKuWSl3hR74fz2KAYD9t2WHX+EavF8higDlnMY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ClVJLf5drjF+TEdbjYJSk6WkeXb9LVHYmUWFpZ+s/d3UGpQrHNz+nVi9OEjhRtmA9 Zexpz7kAkd43Cy8q6zacrnrbuZBpfhVKEA6ngcs/kYjiAXoa7Nzo0slppr9c7qb+nt 4XpdgQFVkFQkvdpxtpMea/rZPmaUwmwm4+pMPukA= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112843] during GIMPLE pass: bitintlower ICE: SIGSEGV in ranger_cache::range_of_expr (gimple-range-cache.cc:1204) with _BitInt() at -O1 Date: Mon, 04 Dec 2023 14:32:48 +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: rguenth 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=3D112843 --- Comment #4 from Richard Biener --- (In reply to Richard Biener from comment #3) > (In reply to Richard Biener from comment #2) > > what?! Ick. It definitely shouldn't re-fold anything but only scrap c= aches > > _at most_. >=20 > So it does >=20 > // Only update if it already had a value. > if (m_cache.get_global_range (r, lhs)) > { > // Re-calculate a new value using just cache values. > Value_Range tmp (TREE_TYPE (lhs)); > fold_using_range f; > fur_stmt src (s, &m_cache); > f.fold_stmt (tmp, s, src, lhs); >=20 > // Combine the new value with the old value to check for a change. > if (r.intersect (tmp)) > { > if (dump_file && (dump_flags & TDF_DETAILS)) > { > print_generic_expr (dump_file, lhs, TDF_SLIM); > fprintf (dump_file, " : global value re-evaluated to "); > r.dump (dump_file); > fputc ('\n', dump_file); > } > m_cache.set_global_range (lhs, r); >=20 > WTF? If a pass invalidates a range it needs to properly do this itself. > But update_stmt itself _never_ should alter range info. At least the testcase that was added with it still passes when I remove the call to get_range_query (fn)->update_stmt=