tree-optimization/96931 - clear ctrl-altering flag more aggressively
authorRichard Biener <rguenther@suse.de>
Fri, 4 Sep 2020 10:18:38 +0000 (12:18 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 4 Sep 2020 10:22:29 +0000 (12:22 +0200)
commitfab77644842869adc8871e133e4c3f4c35b2b245
tree8c0551b4af84ec3767be87c5816467e8e976c56b
parentb898878032a5bbba0d1a981db6399664181531e9
tree-optimization/96931 - clear ctrl-altering flag more aggressively

The testcase shows that we fail to clear gimple_call_ctrl_altering_p
when the last abnormal edge goes away, causing an edge insert to
a loop header edge when we have preheaders to split the edge
unnecessarily.

The following addresses this by more aggressively clearing the
flag in cleanup_call_ctrl_altering_flag.

2020-09-04  Richard Biener  <rguenther@suse.de>

PR tree-optimization/96931
* tree-cfgcleanup.c (cleanup_call_ctrl_altering_flag): If
there's a fallthru edge and no abnormal edge the call is
no longer control-altering.
(cleanup_control_flow_bb): Pass down the BB to
cleanup_call_ctrl_altering_flag.

* gcc.dg/pr96931.c: New testcase.
gcc/testsuite/gcc.dg/pr96931.c [new file with mode: 0644]
gcc/tree-cfgcleanup.c