From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4229C3858297; Fri, 29 Jul 2022 13:46:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4229C3858297 From: "jakub at gcc dot gnu.org" 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, 29 Jul 2022 13:46:09 +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, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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 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, 29 Jul 2022 13:46:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105980 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- If we follow what other backends do in *_output_mi_thunk, it would be --- gcc/config/i386/i386.cc.jj 2022-07-26 10:32:23.373275765 +0200 +++ gcc/config/i386/i386.cc 2022-07-29 15:25:26.023555541 +0200 @@ -21396,6 +21396,7 @@ x86_output_mi_thunk (FILE *file, tree th tmp_regno =3D CX_REG; } + reload_completed =3D 1; emit_note (NOTE_INSN_PROLOGUE_END); /* CET is enabled, insert EB instruction. */ @@ -21561,6 +21562,9 @@ x86_output_mi_thunk (FILE *file, tree th final (insn, file, 1); final_end_function (); assemble_end_function (thunk_fndecl, fnname); + + /* Stop pretending to be a post-reload pass. */ + reload_completed =3D 0; } static void Unfortunately, that doesn't help much, the next problem is that it needs pic_offset_table_rtx as a hard register, so we probably before tmp =3D gen_rtx_REG (word_mode, tmp_regno); if (GET_MODE (fnaddr) !=3D word_mode) fnaddr =3D gen_rtx_ZERO_EXTEND (word_mode, fnaddr); emit_move_insn (tmp, fnaddr); fnaddr =3D tmp; in the above mentioned snippet need to do something like: if (flag_pic && !TARGET_64BIT && !TARGET_MACHO && SYMBOLIC_CONST (fnaddr)) { pic_offset_table_rtx =3D gen_reg_RTX (Pmode, some_suitable_re= g); ix86_init_pic_reg (); } or something similar. But unsure about the exact conditions, insert_insn_on_edge will likely not work either etc. So it likely needs emit_insn (gen_set_got (reg)) etc. directly. }=