From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B92073850405; Tue, 30 Mar 2021 09:14:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B92073850405 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99824] [10 Regression] ICE in wide_int_to_tree_1, at tree.c:1572 Date: Tue, 30 Mar 2021 09:14:30 +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: 10.2.1 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Mar 2021 09:14:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99824 --- Comment #7 from Richard Biener --- So we're value-numbering a char load Value numbering stmt =3D _177 =3D *sc_175; with sc_175 =3D=3D _7 and _7 =3D &cx_41(D)->i2c_adap[i_24].name; which get's us a valueized ref (of type 'char') that looks like cx_41(D)->i2c_adap[i_24].name and ao_ref_init_from_vn_reference turning that into $1 =3D {ref =3D , base =3D ,=20 offset =3D {> =3D {coeffs =3D {388000}}, },=20 size =3D {> =3D {coeffs =3D {384}}, },=20 max_size =3D {> =3D {coeffs =3D {384}}, },=20 ref_alias_set =3D 0, base_alias_set =3D 0, volatile_p =3D false} because it looks at COMPONENT_REF/BIT_FIELD_REF sizes but those really only represent offsets (well, not really really, but ...). We then arrive at # .MEM_170 =3D VDEF <.MEM_169> cx_41(D)->i2c_adap[i_24].name =3D "cx18 i2c driver"; So this looks like a latent thing waiting to happen. The GIMPLE FE is currently not happy to produce a testcase. Trunk is somewhat more resilent to produce the situation since vn_reference_maybe_forwprop_address uses the SSA lattice for the address offset calculation (in this case i_24 has value zero). With the proposed assert at least the LTRANS unit reproduces an ICE with a debug build for me.=