From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9FE903857B9A; Fri, 17 Jun 2022 10:21:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9FE903857B9A From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105980] [11/12/13 Regression] ICE in final_scan_insn_1, at final.cc:2811 Date: Fri, 17 Jun 2022 10:21:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com 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: 11.4 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: Fri, 17 Jun 2022 10:21:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105980 --- Comment #2 from Uro=C5=A1 Bizjak --- emit_move_insn in this part of ix86_output_mi_thunk: 21464 if (!sibcall_insn_operand (fnaddr, word_mode)) 21465 { 21466 tmp =3D gen_rtx_REG (word_mode, tmp_regno); 21467 if (GET_MODE (fnaddr) !=3D word_mode) 21468 fnaddr =3D gen_rtx_ZERO_EXTEND (word_mode, fnaddr); 21469 emit_move_insn (tmp, fnaddr); 21470 fnaddr =3D tmp; 21471 } is creating RTX with pseudos when trying to move fnaddr: (symbol_ref:SI ("*.LTHUNK0") [flags 0x3] ) to a temporary register: (insn 6 5 7 (set (reg:SI 82) (plus:SI (reg:SI 82) (const:SI (unspec:SI [ (symbol_ref:SI ("*.LTHUNK0") [flags 0x3] ) ] UNSPEC_GOTOFF)))) "pr105980.C":4:8 -1 (nil)) (insn 7 6 8 (set (reg:SI 2 cx) (reg:SI 82)) "pr105980.C":4:8 -1 (expr_list:REG_EQUAL (symbol_ref:SI ("*.LTHUNK0") [flags 0x3] ) (nil))) This won't fly when we are in the final pass, way late after reload.=