From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9B0543856957; Thu, 4 May 2023 07:44:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B0543856957 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683186298; bh=gWleAza3+i5HNzWV78ll/4KGg1Gde80GdGje7rE4GJQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SltrgRV6RDnO+XiY0AQZ/Ehd857fcaONaTw5t2kOf4sf9k8WFxXAsTuiSUfZGBqmy xXoU+xnjpJJRutn597n9amqWQhyjGXwZfEkbhzg6DOHhmRj6FWBFBVhVKhqxJODYAQ axfcWbRLKPTQPJTlWMBx6Ds4k47UVIIkofPwIk50= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/109676] [13/14 regression] ICE in simplify_subreg, at simplify-rtx.cc:7426 when building firefox with -O2 -march=alderlake -g since r13-3378-gf6c168f8c06047 Date: Thu, 04 May 2023 07:44:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug 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: P2 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.2 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=3D109676 --- Comment #15 from CVS Commits --- The releases/gcc-13 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:05bc529829f25aacdaa567ef488b353bf2746c5b commit r13-7292-g05bc529829f25aacdaa567ef488b353bf2746c5b Author: Jakub Jelinek Date: Thu May 4 09:36:05 2023 +0200 i386: Fix up handling of debug insns in STV [PR109676] The following testcase ICEs because STV replaces there (debug_insn 114 47 51 8 (var_location:TI D#3 (reg:TI 91 [ p ])) -1 (nil)) with (debug_insn 114 47 51 8 (var_location:TI D#3 (reg:V1TI 91 [ p ])) -1 (nil)) which is invalid because of the mode mismatch. STV has fix_debug_reg_uses function which is supposed to fix this up and adjust such debug insns into (debug_insn 114 47 51 8 (var_location:TI D#3 (subreg:TI (reg:V1TI 91 [ = p ]) 0)) -1 (nil)) but it doesn't trigger here. The IL before stv1 has: (debug_insn 114 47 51 8 (var_location:TI D#3 (reg:TI 91 [ p ])) -1 (nil)) ... (insn 63 62 64 8 (set (mem/c:TI (reg/f:DI 89 [ .result_ptr ]) [0 .mStorage+0 S16 A32]) (reg:TI 91 [ p ])) "pr109676.C":4:48 87 {*movti_internal} (expr_list:REG_DEAD (reg:TI 91 [ p ]) (nil))) in bb 8 and (insn 97 96 98 9 (set (reg:TI 91 [ p ]) (mem/c:TI (plus:DI (reg/f:DI 19 frame) (const_int -32 [0xffffffffffffffe0])) [0 p+0 S16 A128])) "pr109676.C":26:12 87 {*movti_internal} (nil)) (insn 98 97 99 9 (set (mem/c:TI (plus:DI (reg/f:DI 19 frame) (const_int -64 [0xffffffffffffffc0])) [0 tmp+0 S16 A128= ]) (reg:TI 91 [ p ])) "pr109676.C":26:12 87 {*movti_internal} (nil)) in bb9. PUT_MODE on a REG is done in two spots in timode_scalar_chain::convert_insn, one is: switch (GET_CODE (dst)) { case REG: if (GET_MODE (dst) =3D=3D TImode) { PUT_MODE (dst, V1TImode); fix_debug_reg_uses (dst); } if (GET_MODE (dst) =3D=3D V1TImode) when seeing the REG in SET_DEST and another one the hunk the patch adju= sts. Because bb 8 comes first in the order the pass walks the bbs, we first notice the TImode pseudo on insn 63 where it is SET_SRC, use PUT_MODE t= here unconditionally, so for a shared REG it changes all other uses in the I= L, and then don't call fix_debug_reg_uses because DF_REG_DEF_CHAIN (REGNO (src)) is non-NULL - the REG is set in insn 97 but we haven't processed it yet. Later on we process insn 97, but because the REG in SET_DEST already has V1TImode, we don't do anything, even when the src handling code earlier relied on it being done. The following patch fixes this by using similar code for both dst and s= rc, in particular calling fix_debug_reg_uses once when we actually change R= EG mode from TImode to V1TImode, and not later on. 2023-05-04 Jakub Jelinek PR debug/109676 * config/i386/i386-features.cc (timode_scalar_chain::convert_in= sn): If src is REG, change its mode to V1TImode and call fix_debug_reg_uses for it only if it still has TImode. Don't decide whether to ca= ll fix_debug_reg_uses based on whether SRC is ever set or not. * g++.target/i386/pr109676.C: New test. (cherry picked from commit 3a715d3e136fc4dfdc42cb6a3ee1a7df3e2a171a)=