From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D84D6385840F; Tue, 3 May 2022 07:07:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D84D6385840F From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/105459] ICE: Segmentation fault (in record_operand_costs) Date: Tue, 03 May 2022 07:07:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-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: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc cf_gcctarget 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, 03 May 2022 07:07:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105459 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hubicka at gcc dot gnu.org, | |rguenth at gcc dot gnu.org Target| |x86_64-*-* i?86-*-* --- Comment #1 from Richard Biener --- Huh. #1 0x000000000100602f in record_operand_costs (insn=3D0x7ffff652d280, pref= =3D0x0) at /home/rguenther/src/gcc-12-branch/gcc/ira-costs.cc:1382 1382 memcpy (op_costs[i], init_cost, struct_costs_size); (gdb) l 1377 for any allocnos, doing it twice if some pair of operands are 1378 commutative. */ 1379 for (i =3D 0; i < recog_data.n_operands; i++) 1380 { 1381 rtx op_mem =3D extract_mem_from_operand (recog_data.operand[i= ]); 1382 memcpy (op_costs[i], init_cost, struct_costs_size); 1383 gdb) p this_target_ira_int->x_init_cost $7 =3D (costs *) 0x0 we fail to invoke ira_init_costs for the cgraph node when we switch targets. #0 restore_target_globals (g=3D0x7ffff6523cf0) at /home/rguenther/src/gcc-12-branch/gcc/target-globals.h:88 #1 0x0000000002987161 in save_target_globals () at /home/rguenther/src/gcc-12-branch/gcc/target-globals.cc:87 #2 0x00000000029871e8 in save_target_globals_default_opts () at /home/rguenther/src/gcc-12-branch/gcc/target-globals.cc:113 #3 0x0000000001910882 in ix86_set_current_function (fndecl=3D ) at /home/rguenther/src/gcc-12-branch/gcc/config/i386/i386-options.cc:32= 41 #4 0x0000000000df8000 in invoke_set_current_function_hook ( fndecl=3D) at /home/rguenther/src/gcc-12-branch/gcc/function.cc:4702 #5 0x0000000000df8374 in allocate_struct_function ( fndecl=3D, abstract_p=3Dfalse) at /home/rguenther/src/gcc-12-branch/gcc/function.cc:4825 #6 0x0000000000df867b in push_struct_function ( fndecl=3D) at /home/rguenther/src/gcc-12-branch/gcc/function.cc:4891 #7 0x00000000010905d0 in input_function ( fn_decl=3D, data_in=3D0x3f36e50,=20 ib=3D0x7fffffffd920, ib_cfg=3D0x7fffffffd900,=20 node=3D) at /home/rguenther/src/gcc-12-branch/gcc/lto-streamer-in.cc:1386 not sure when we are supposed to initialize costs here?=