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

--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 11 Nov 2019, iii at linux dot ibm.com wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92430
> 
> --- Comment #3 from Ilya Leoshkevich <iii at linux dot ibm.com> ---
> Findings so far: when we forward an edge like this:
> 
> #0  redirect_edge_succ (e=0x7ffff6d73cc0, new_succ=0x7ffff6c2aa90) at
> ../.././gcc/cfg.c:368
> #1  0x0000000000a776ff in redirect_edge_succ_nodup (e=0x7ffff6d73cc0,
> new_succ=0x7ffff6c2aa90) at ../.././gcc/cfghooks.c:469
> #2  0x0000000000a9c18a in cfg_layout_redirect_edge_and_branch
> (e=0x7ffff6d73cc0, dest=0x7ffff6c2aa90) at ../.././gcc/cfgrtl.c:4500
> #3  0x0000000000a77419 in redirect_edge_and_branch (e=0x7ffff6d73cc0,
> dest=0x7ffff6c2aa90) at ../.././gcc/cfghooks.c:373
> #4  0x0000000002496e8d in try_forward_edges (mode=40, b=0x7ffff6d86680) at
> ../.././gcc/cfgcleanup.c:563
> #5  0x00000000024a2654 in try_optimize_cfg (mode=40) at
> ../.././gcc/cfgcleanup.c:2961
> #6  0x00000000024a2d1a in cleanup_cfg (mode=40) at
> ../.././gcc/cfgcleanup.c:3175
> #7  0x00000000024a2f29 in (anonymous
> namespace)::pass_jump_after_combine::execute (this=0x38a2b00) at
> ../.././gcc/cfgcleanup.c:3315
> 
> we don't seem to correctly update dominance info (if at all), making it
> inconsistent with the actual CFG. In this particular case, inconsistency
> makes the following call chain produce a loop in the dominator tree:
> 
> #3  0x0000000000b37638 in redirect_immediate_dominators (dir=CDI_DOMINATORS,
> bb=0x7ffff6c2ab60, to=0x7ffff6d867b8) at ../.././gcc/dominance.c:995
> #4  0x0000000000a7838c in merge_blocks (a=0x7ffff6d867b8, b=0x7ffff6c2ab60) at
> ../.././gcc/cfghooks.c:852
> #5  0x00000000024a1a1d in try_optimize_cfg (mode=40) at
> ../.././gcc/cfgcleanup.c:2825
> #6  0x00000000024a2d1a in cleanup_cfg (mode=40) at
> ../.././gcc/cfgcleanup.c:3175
> #7  0x00000000024a2f29 in (anonymous
> namespace)::pass_jump_after_combine::execute (this=0x38a2b00) at
> ../.././gcc/cfgcleanup.c:3315
> 
> which ultimately leads to the hang that we are observing.

Passes that do not update dominators need to free them at the start.
RTL is quite lazy here and moving passes around can move it to a part
in the pipeline where they are present.  In particular cleanup_cfg
doesn't.

Reply via email to