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

--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note the BLOCK is lost somewhere between CFG build (still OK as by
verify_gimple_in_cfg) and free_lang_data where it is lost.

Oh, so the BLOCK in question is used in two different functions BIND_EXPRs
and thus during the lowering of another function the BLOCK tree of the first
function referencing the BLOCK is garbled.

(gdb) p cfun->decl->decl_common.initial 
$18 = <block 0x7ffff6478300>
(gdb) p cfun->decl->decl_common.initial->block.supercontext 
$19 = <block 0x7ffff6478360>
(gdb) p cfun->decl->decl_common.initial->block.supercontext->block.supercontext
$20 = <block 0x7ffff6478600>
(gdb) p
cfun->decl->decl_common.initial->block.supercontext->block.supercontext->block.supercontext->block.supercontext
$21 = <function_decl 0x7ffff6483d00 operator()>

  gcc_assert (BLOCK_SUPERCONTEXT (DECL_INITIAL (current_function_decl))
              == current_function_decl);

at the start of lower_function_body will trip on this.  So somewhere coroutines
functions are constructed we fail to copy the BLOCK tree of shared parts.

Reply via email to