https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105104

            Bug ID: 105104
           Summary: [coroutines] ICE during GIMPLE pass:
                    coro-early-expand-ifns
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jehelset at gmail dot com
  Target Milestone: ---

Created attachment 52716
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52716&action=edit
Output from "-fdump-tree-coro-early-expand-ifns=stdout"

Compiler segfaults on `if (EDGE_COUNT (pred->succs) <= EDGE_COUNT
(succ->preds))`, as `succ` is null. 

Backtrace:
#0  0x000000000107a2ae in find_edge (pred=0x7fffc626f068, succ=0x0) at
../../gcc/cfganal.cc:523
#1  0x0000000001864cc7 in convert_single_case_switch (swtch=0x7fffc625d2d0,
gsi=...) at ../../gcc/tree-cfgcleanup.cc:118
#2  0x0000000001864d9e in cleanup_control_expr_graph (bb=0x7fffc626f068,
gsi=...) at ../../gcc/tree-cfgcleanup.cc:145
#3  0x00000000018652be in cleanup_control_flow_bb (bb=0x7fffc626f068) at
../../gcc/tree-cfgcleanup.cc:274
#4  0x000000000186712f in cleanup_control_flow_pre () at
../../gcc/tree-cfgcleanup.cc:908
#5  0x00000000018678f2 in cleanup_tree_cfg_noloop (ssa_update_flags=0) at
../../gcc/tree-cfgcleanup.cc:1073
#6  0x0000000001867bbb in cleanup_tree_cfg (ssa_update_flags=0) at
../../gcc/tree-cfgcleanup.cc:1183
#7  0x00000000016893c6 in execute_function_todo (fn=0x7fffcf0580b8, data=0x60)
at ../../gcc/passes.cc:2051
#8  0x00000000016881d9 in do_per_function (callback=0x1689361
<execute_function_todo(function*, void*)>, data=0x60) at
../../gcc/passes.cc:1688
#9  0x000000000168972e in execute_todo (flags=96) at ../../gcc/passes.cc:2139
#10 0x000000000168a838 in execute_one_pass (pass=0x408fb20) at
../../gcc/passes.cc:2675
#11 0x000000000168aa9b in execute_pass_list_1 (pass=0x408fb20) at
../../gcc/passes.cc:2738
#12 0x000000000168ab25 in execute_pass_list (fn=0x7fffcf0580b8, pass=0x408f6a0)
at ../../gcc/passes.cc:2749
#13 0x00000000010f6cbf in cgraph_node::analyze (this=0x7fffcf07d880) at
../../gcc/cgraphunit.cc:685
#14 0x00000000010f8daa in analyze_functions (first_time=true) at
../../gcc/cgraphunit.cc:1240
#15 0x00000000010fc094 in symbol_table::finalize_compilation_unit
(this=0x7ffff70c6000) at ../../gcc/cgraphunit.cc:2500
#16 0x00000000017eb979 in compile_file () at ../../gcc/toplev.cc:479
#17 0x00000000017eea61 in do_compile (no_backend=false) at
../../gcc/toplev.cc:2168
#18 0x00000000017eee49 in toplev::main (this=0x7fffffffdf62, argc=33,
argv=0x7fffffffe098) at ../../gcc/toplev.cc:2320
#19 0x0000000002fd18b1 in main (argc=33, argv=0x7fffffffe098) at
../../gcc/main.cc:39

Dump from tree-coro-early-expand-ifns put in attachment, because of
template-spew.

Compiled with e3d2b0d040e9baf6c0548b865ed5244dec464cc1.

Reply via email to