From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DBFB9385842F; Sat, 3 Feb 2024 10:14:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DBFB9385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706955269; bh=kkqqZaKS/ZfIs4JJWAyORs3OZ4AN2b/WjLf98n6kuOg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=nOI0TCVAnPvXYlEdDUazLG+KmcXr8iNQO6GbyL+kxm3SzBldUFnYq/RuH54L1S8hy 21E3iC4/TjAaTf6ZmnBaR1pQ5WQ2SOh7ogUXXA4iPN+KSqWHm7zdNXUvR9tXEM7M4U MoRX4Zd4MItAh/fAXBqo3PFru6iGGR06+O6m2oEk= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113735] ICE: in operator[], at vec.h:910 with _BitInt() at -O and above Date: Sat, 03 Feb 2024 10:14:27 +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: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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: everconfirmed cf_reconfirmed_on bug_status 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=3D113735 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2024-02-03 Status|UNCONFIRMED |NEW CC| |aldyh at gcc dot gnu.org, | |amacleod at redhat dot com --- Comment #1 from Jakub Jelinek --- Slightly tweaked, still -O1: char b; void bar (void); void foo (_BitInt(6110) j) { for (;;) { _BitInt(10) k =3D b % j; for (j =3D 6; j; --j) if (k) bar (); } } The ICE is in on: 721 if (!m_equiv[bb->index]) because bb->index is larger than m_equiv size. The bitint lowering pass works by walking the IL and replacing some stateme= nts in there with lowered code, which can involve new basic blocks (either thro= ugh splitting existing blocks or creating fresh new ones) and the like. And as= ks the ranger about range of statements during that. Is that something that ranger doesn't/can't support? So, would I need to ensure to find out what ranges I'll need before making = any changes, ask for them, remember them somewhere on the side and then use them during = the transformations? #0 fancy_abort (file=3D0x2c76d8a "../../gcc/vec.h", line=3D910, function= =3D0x2c76d7f "operator[]") at ../../gcc/diagnostic.cc:2313 #1 0x00000000011fcb6b in vec::operator[] (this=3D0x39fb660 =3D {...}, ix=3D16) at ../../gcc/vec.h:910 #2 0x00000000011fc4b7 in vec::operator[] (Python Exception : There is no member or method named m_vecpfx. this=3D0x39fc050, ix=3D16) at ../../gcc/vec.h:1599 #3 0x00000000011f81c4 in equiv_oracle::add_equiv_to_block (this=3D0x39fbf8= 0, bb=3D, equiv_set=3D0x3ad29b8) at ../../gcc/value-relation.cc:721 #4 0x00000000011f7f1e in equiv_oracle::register_initial_def (this=3D0x39fb= f80, ssa=3D) at ../../gcc/value-relation.cc:643 #5 0x00000000011f8025 in equiv_oracle::register_relation (this=3D0x39fbf80, bb=3D, k=3DVREL_EQ, ssa1=3D,=20 ssa2=3D) at ../../gcc/value-relation.cc:675 #6 0x00000000011f98a5 in dom_oracle::register_relation (this=3D0x39fbf80, bb=3D, k=3DVREL_EQ, op1=3D,=20 op2=3D) at ../../gcc/value-relation.cc:1111 #7 0x00000000011f96d7 in relation_oracle::register_stmt (this=3D0x39fbf80, stmt=3D, k=3DVREL_EQ, op1=3D,=20 op2=3D) at ../../gcc/value-relation.cc:1069 #8 0x00000000025fb5fe in fur_depend::register_relation (this=3D0x7fffffffb= cd0, s=3D, k=3DVREL_EQ, op1=3D,=20 op2=3D) at ../../gcc/gimple-range-fold.cc:2= 02 #9 0x00000000025fe3d3 in fold_using_range::range_of_phi (this=3D0x7fffffff= bcff, r=3D..., phi=3D0x7fffea30ae00, src=3D...) at ../../gcc/gimple-range-fold.cc= :932 #10 0x00000000025fcaa8 in fold_using_range::fold_stmt (this=3D0x7fffffffbcf= f, r=3D..., s=3D, src=3D..., name=3D) at ../../gcc/gimple-range-fold.cc:604 #11 0x00000000025ee502 in gimple_ranger::fold_range_internal (this=3D0x3b91= ca0, r=3D..., s=3D, name=3D) at ../../gcc/gimple-range.cc:265 #12 0x00000000025eeb24 in gimple_ranger::prefill_stmt_dependencies (this=3D0x3b91ca0, ssa=3D) at ../../gcc/gimple-range.cc:404 #13 0x00000000025ee7c3 in gimple_ranger::range_of_stmt (this=3D0x3b91ca0, r= =3D..., s=3D, name=3D) at ../../gcc/gimple-range.cc:322 #14 0x00000000025edc52 in gimple_ranger::range_of_expr (this=3D0x3b91ca0, r= =3D..., expr=3D, stmt=3D) at ../../gcc/gimple-range.cc:134 #15 0x00000000025cb0a0 in (anonymous namespace)::range_to_prec (op=3D, stmt=3D) at ../../gcc/gimple-lower-bitint.cc:2008 #16 0x00000000025cc539 in (anonymous namespace)::bitint_large_huge::handle_operand_addr (this=3D0x7fffffffd560, op=3D, stmt=3D,=20 prec_stored=3D0x0, prec=3D0x7fffffffd148) at ../../gcc/gimple-lower-bitint.cc:2211 #17 0x00000000025d3688 in (anonymous namespace)::bitint_large_huge::lower_muldiv_stmt (this=3D0x7fffffffd560, obj=3D, stmt=3D) at ../../gcc/gimple-lower-bitint.cc:3403 #18 0x00000000025de784 in (anonymous namespace)::bitint_large_huge::lower_s= tmt (this=3D0x7fffffffd560, stmt=3D) at ../../gcc/gimple-lower-bitint.cc:5439 #19 0x00000000025e4297 in gimple_lower_bitint () at ../../gcc/gimple-lower-bitint.cc:6575 #20 0x00000000025e5719 in (anonymous namespace)::pass_lower_bitint::execute (this=3D0x3a10fe0) at ../../gcc/gimple-lower-bitint.cc:6837=