aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-05-06 10:23:15 +0200
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 12:57:43 -0300
commit01b1115e9b3b8e786ecfea2f3084821f072b7ea8 (patch)
tree248cd6f3960cfb19096bf29f14a1e4a9b1645ec3 /gcc
parent5b3043b9dabdeecdf13bd216adae95ac69288613 (diff)
downloadgcc-01b1115e9b3b8e786ecfea2f3084821f072b7ea8.zip
gcc-01b1115e9b3b8e786ecfea2f3084821f072b7ea8.tar.gz
gcc-01b1115e9b3b8e786ecfea2f3084821f072b7ea8.tar.bz2
middle-end/94964 - avoid EH loop entry with CP_SIMPLE_PREHEADERS
Loop optimizers expect to be able to insert on the preheader edge w/o splitting it thus avoid ending up with a preheader that enters the loop via an EH edge (or an abnormal edge). 2020-05-06 Richard Biener <rguenther@suse.de> PR middle-end/94964 * cfgloopmanip.c (create_preheader): Require non-complex preheader edge for CP_SIMPLE_PREHEADERS.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgloopmanip.c5
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 73a6015..ae6dd06 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2020-05-06 Richard Biener <rguenther@suse.de>
+ PR middle-end/94964
+ * cfgloopmanip.c (create_preheader): Require non-complex
+ preheader edge for CP_SIMPLE_PREHEADERS.
+
+2020-05-06 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/94963
* tree-ssa-loop-im.c (execute_sm_if_changed): Remove
no-warning marking of the conditional store.
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index 50c7267..73134a2 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -1506,9 +1506,10 @@ create_preheader (class loop *loop, int flags)
else
{
/* If we want simple preheaders, also force the preheader to have
- just a single successor. */
+ just a single successor and a normal edge. */
if ((flags & CP_SIMPLE_PREHEADERS)
- && !single_succ_p (single_entry->src))
+ && ((single_entry->flags & EDGE_COMPLEX)
+ || !single_succ_p (single_entry->src)))
need_forwarder_block = true;
/* If we want fallthru preheaders, also create forwarder block when
preheader ends with a jump or has predecessors from loop. */