[Bug middle-end/87162] [6.2.0] Internal compiler error: Error reporting routines re-entered.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87162 ma.jiang at zte dot com.cn changed: What|Removed |Added CC||ma.jiang at zte dot com.cn --- Comment #8 from ma.jiang at zte dot com.cn --- (In reply to Wen Yang from comment #7) > This patch will make it more robust: > > # git diff > diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c > index 1d4eb80..326e1c4 100644 > --- a/gcc/trans-mem.c > +++ b/gcc/trans-mem.c > @@ -2099,6 +2099,9 @@ gate_tm_init (void) >if (!flag_tm) > return false; > > + if (!cfun->cfg) > +return false; > + >calculate_dominance_info (CDI_DOMINATORS); >bitmap_obstack_initialize (_obstack); I think gate functions should not do complex compute. gate_tm_init should be split into two parts.
[Bug middle-end/87162] [6.2.0] Internal compiler error: Error reporting routines re-entered.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87162 --- Comment #7 from Wen Yang --- This patch will make it more robust: # git diff diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index 1d4eb80..326e1c4 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -2099,6 +2099,9 @@ gate_tm_init (void) if (!flag_tm) return false; + if (!cfun->cfg) +return false; + calculate_dominance_info (CDI_DOMINATORS); bitmap_obstack_initialize (_obstack);
[Bug middle-end/87162] [6.2.0] Internal compiler error: Error reporting routines re-entered.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87162 --- Comment #6 from Wen Yang --- We may simply construct this error scenario: # /var/weny/release_gcc_trunk/usr/local/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/cc1 -fdump-passes -fgnu-tm applets.i This section of code has a bug: static bool gate_tm_init (void) { if (!flag_tm) return false; calculate_dominance_info (CDI_DOMINATORS); ---》cfun may be NULL.
[Bug middle-end/87162] [6.2.0] Internal compiler error: Error reporting routines re-entered.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87162 --- Comment #5 from Wen Yang --- (gdb) p *(opt_pass *) 0x2434380 $4 = { = {type = GIMPLE_PASS, name = 0x18530f0 "*tminit", optinfo_flags = 0, tv_id = TV_TRANS_MEM, properties_required = 40, properties_provided = 0, properties_destroyed = 0, todo_flags_start = 524288, todo_flags_finish = 0}, _vptr.opt_pass = 0x1853508 , sub = 0x24343e0, next = 0x2434500, static_pass_number = -1, graph_dump_initialized = false, m_ctxt = 0x240b3d0} (gdb) p cfun $5 = (function *) 0x7fffd16e83f0 (gdb) p *cfun $6 = {eh = 0x7fffd12e8030, cfg = 0x0, gimple_body = 0x0, gimple_df = 0x0, x_current_loops = 0x0, su = 0x0, value_histograms = 0x0, decl = 0x7fffd24e8e00, static_chain_decl = 0x0, nonlocal_goto_save_area = 0x0, local_decls = 0x0, cilk_frame_decl = 0x0, machine = 0x7fffd36e88c0, language = 0x0, used_types_hash = 0x0, fde = 0x0, last_stmt_uid = 0, funcdef_no = 72, function_start_locus = 0, function_end_locus = 0, curr_properties = 0, last_verified = 0, cannot_be_copied_reason = 0x0, last_clique = 0, va_list_gpr_size = 255, va_list_fpr_size = 255, calls_setjmp = 0, calls_alloca = 0, is_cilk_function = 0, calls_cilk_spawn = 0, has_nonlocal_label = 0, has_forced_label_in_static = 0, cannot_be_copied_set = 0, stdarg = 0, after_inlining = 0, always_inline_functions_inlined = 0, can_throw_non_call_exceptions = 0, can_delete_dead_exceptions = 0, returns_struct = 0, returns_pcc_struct = 0, has_local_explicit_reg_vars = 0, is_thunk = 0, has_force_vectorize_loops = 0, has_simduid_loops = 0, tail_call_marked = 0} cfun->cfg is NULL.
[Bug middle-end/87162] [6.2.0] Internal compiler error: Error reporting routines re-entered.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87162 --- Comment #4 from Wen Yang --- Program received signal SIGSEGV, Segmentation fault. 0x00929fa1 in calculate_dominance_info (dir=CDI_DOMINATORS) at ../../gcc-6.2.0/gcc/dominance.c:633 633 if (dom_computed[dir_index] == DOM_OK) Missing separate debuginfos, use: debuginfo-install glibc-2.17-196.el7.x86_64 gmp-6.0.0-15.el7.x86_64 libmpc-1.0.1-3.el7.x86_64 mpfr-3.1.1-4.el7.x86_64 zlib-1.2.7-17.el7.x86_64 (gdb) bt #0 0x00929fa1 in calculate_dominance_info (dir=CDI_DOMINATORS) at ../../gcc-6.2.0/gcc/dominance.c:633 #1 0x00d62673 in gate_tm_init () at ../../gcc-6.2.0/gcc/trans-mem.c:2100 #2 0x00d6289b in (anonymous namespace)::pass_tm_init::gate (this=0x2434380) at ../../gcc-6.2.0/gcc/trans-mem.c:2156 #3 0x00c44738 in dump_one_pass (pass=0x2434380, pass_indent=1) at ../../gcc-6.2.0/gcc/passes.c:908 #4 0x00c4483e in dump_pass_list (pass=0x2434380, indent=1) at ../../gcc-6.2.0/gcc/passes.c:930 #5 0x00c44915 in gcc::pass_manager::dump_passes (this=0x242e580) at ../../gcc-6.2.0/gcc/passes.c:956 #6 0x00c4488f in dump_passes () at ../../gcc-6.2.0/gcc/passes.c:942 #7 0x008eaa25 in symbol_table::finalize_compilation_unit (this=0x704ed0a8) at ../../gcc-6.2.0/gcc/cgraphunit.c:2538 #8 0x00d58f45 in compile_file () at ../../gcc-6.2.0/gcc/toplev.c:488 #9 0x00d5b3ee in do_compile () at ../../gcc-6.2.0/gcc/toplev.c:1986 #10 0x00d5b678 in toplev::main (this=0x7fffa7a0, argc=585, argv=0x7fffa8a8) at ../../gcc-6.2.0/gcc/toplev.c:2094 #11 0x0167e46e in main (argc=585, argv=0x7fffa8a8) at ../../gcc-6.2.0/gcc/main.c:39 (gdb) p dir_index $1 = 0 (gdb) l 628 void 629 calculate_dominance_info (cdi_direction dir) 630 { 631 unsigned int dir_index = dom_convert_dir_to_idx (dir); 632 633 if (dom_computed[dir_index] == DOM_OK) 634 { 635 checking_verify_dominators (dir); 636 return; 637 } #define dom_computed (cfun->cfg->x_dom_computed) (gdb) disassemble calculate_dominance_info Dump of assembler code for function calculate_dominance_info(cdi_direction): 0x00929f6e <+0>: push %rbp 0x00929f6f <+1>: mov%rsp,%rbp 0x00929f72 <+4>: sub$0xc0,%rsp 0x00929f79 <+11>:mov%edi,-0xb4(%rbp) 0x00929f7f <+17>:mov-0xb4(%rbp),%eax 0x00929f85 <+23>:mov%eax,%edi 0x00929f87 <+25>:callq 0x928e19 0x00929f8c <+30>:mov%eax,-0xc(%rbp) 0x00929f8f <+33>:mov0x19bd1a2(%rip),%rax# 0x22e7138 0x00929f96 <+40>:mov0x8(%rax),%rax 0x00929f9a <+44>:mov-0xc(%rbp),%edx 0x00929f9d <+47>:add$0xc,%rdx 0x00929fa1 <+51>:mov0x4(%rax,%rdx,4),%eax 0x00929fa5 <+55>:cmp$0x2,%eax 0x00929fa8 <+58>:jne0x929fbc .. (gdb) p *(struct function *) 0x22e7138 $3 = {eh = 0x7fffd16e83f0, cfg = 0x0, gimple_body = 0x0, gimple_df = 0x49, x_current_loops = 0x0, su = 0x0, value_histograms = 0x0, decl = 0x0, static_chain_decl = 0x0, nonlocal_goto_save_area = 0x0, local_decls = 0x0, cilk_frame_decl = 0x1, machine = 0x24230c0, language = 0x0, used_types_hash = 0x0, fde = 0x0, last_stmt_uid = 0, funcdef_no = 0, function_start_locus = 0, function_end_locus = 0, curr_properties = 0, last_verified = 0, cannot_be_copied_reason = 0x0, last_clique = 0, va_list_gpr_size = 0, va_list_fpr_size = 0, calls_setjmp = 0, calls_alloca = 0, is_cilk_function = 0, calls_cilk_spawn = 0, has_nonlocal_label = 0, has_forced_label_in_static = 0, cannot_be_copied_set = 0, stdarg = 0, after_inlining = 0, always_inline_functions_inlined = 0, can_throw_non_call_exceptions = 0, can_delete_dead_exceptions = 0, returns_struct = 0, returns_pcc_struct = 0, has_local_explicit_reg_vars = 0, is_thunk = 0, has_force_vectorize_loops = 0, has_simduid_loops = 0, tail_call_marked = 0}
[Bug middle-end/87162] [6.2.0] Internal compiler error: Error reporting routines re-entered.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87162 Richard Biener changed: What|Removed |Added Component|c |middle-end --- Comment #3 from Richard Biener --- Probably happens even with an empty CU since it ICEs in dump_pass_list.