https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105459
Richard Biener <rguenth at gcc dot gnu.org> 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 <rguenth at gcc dot gnu.org> --- Huh. #1 0x000000000100602f in record_operand_costs (insn=0x7ffff652d280, pref=0x0) 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 = 0; i < recog_data.n_operands; i++) 1380 { 1381 rtx op_mem = 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 = (costs *) 0x0 we fail to invoke ira_init_costs for the cgraph node when we switch targets. #0 restore_target_globals (g=0x7ffff6523cf0) 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= <function_decl 0x7ffff6346600 main>) at /home/rguenther/src/gcc-12-branch/gcc/config/i386/i386-options.cc:3241 #4 0x0000000000df8000 in invoke_set_current_function_hook ( fndecl=<function_decl 0x7ffff6346600 main>) at /home/rguenther/src/gcc-12-branch/gcc/function.cc:4702 #5 0x0000000000df8374 in allocate_struct_function ( fndecl=<function_decl 0x7ffff6346600 main>, abstract_p=false) at /home/rguenther/src/gcc-12-branch/gcc/function.cc:4825 #6 0x0000000000df867b in push_struct_function ( fndecl=<function_decl 0x7ffff6346600 main>) at /home/rguenther/src/gcc-12-branch/gcc/function.cc:4891 #7 0x00000000010905d0 in input_function ( fn_decl=<function_decl 0x7ffff6346600 main>, data_in=0x3f36e50, ib=0x7fffffffd920, ib_cfg=0x7fffffffd900, node=<cgraph_node * 0x7ffff6349000 "main"/5>) at /home/rguenther/src/gcc-12-branch/gcc/lto-streamer-in.cc:1386 not sure when we are supposed to initialize costs here?