From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 851163858C39; Thu, 16 Sep 2021 09:18:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 851163858C39 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102360] ICE in can_native_interpret_type_p at gcc/fold-const.c:8800 Date: Thu, 16 Sep 2021 09:18:51 +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: 12.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: P1 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: everconfirmed bug_status assigned_to cf_reconfirmed_on 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: Thu, 16 Sep 2021 09:18:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102360 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot = gnu.org Last reconfirmed| |2021-09-16 --- Comment #1 from Richard Biener --- Confirmed. Program received signal SIGSEGV, Segmentation fault. 0x00000000012f2e6b in can_native_interpret_type_p (type=3D) at ../../src/trunk/gcc/fold-const.c:8800 8800 switch (TREE_CODE (type)) 3049 if (!can_native_interpret_type_p (var_type)) 3050 { 3051 alt_type 3052 =3D lang_hooks.types.type_for_mode (TYPE_MODE (var_= type), 3053 TYPE_UNSIGNED (var_type)); 3054 gcc_assert (can_native_interpret_type_p (alt_type)); 3055 } alt_type doesn't need to exist. TYPE_MODE is OImode here. Another issue will be that native_interpret_int refuses to interpret types bigger than 128bit. So using alt_type =3D build_nonstandard_integer_type=20 (GET_MODE_BITSIZE (TYPE_MODE (var_type)), 1); will likely not help. But if we know we're using an integer type we can natively interpret ourselves. Note there's another hole with variable-size and SVE vector modes I think. I'm testing something.=