aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-06-19 21:31:44 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-06-19 21:31:44 +0000
commit180720a5619f319261b28871eb6228063c3b1164 (patch)
tree4bcef14bccab086c4c16460e2ac9131431237b91 /gcc
parentf7e94dfb68d48b936044f7a631540e83b4a8b163 (diff)
downloadgcc-180720a5619f319261b28871eb6228063c3b1164.zip
gcc-180720a5619f319261b28871eb6228063c3b1164.tar.gz
gcc-180720a5619f319261b28871eb6228063c3b1164.tar.bz2
tree-cfgcleanup.c (tree_forwarder_block_p): Do not return false at -O0 if the locus represent UNKNOWN_LOCATION but have...
* tree-cfgcleanup.c (tree_forwarder_block_p): Do not return false at -O0 if the locus represent UNKNOWN_LOCATION but have different values. From-SVN: r261770
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-cfgcleanup.c12
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index cc607eb..8698635 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-19 Eric Botcazou <ebotcazou@adacore.com>
+
+ * tree-cfgcleanup.c (tree_forwarder_block_p): Do not return false at
+ -O0 if the locus represent UNKNOWN_LOCATION but have different values.
+
2018-06-19 Aaron Sawdey <acsawdey@linux.ibm.com>
* config/rs6000/rs6000-string.c (select_block_compare_mode): Check
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index d5464fd..b27ba8a 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -346,8 +346,11 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted)
if (e->src == ENTRY_BLOCK_PTR_FOR_FN (cfun) || (e->flags & EDGE_EH))
return false;
/* If goto_locus of any of the edges differs, prevent removing
- the forwarder block for -O0. */
- else if (optimize == 0 && e->goto_locus != locus)
+ the forwarder block when not optimizing. */
+ else if (!optimize
+ && (LOCATION_LOCUS (e->goto_locus) != UNKNOWN_LOCATION
+ || LOCATION_LOCUS (locus) != UNKNOWN_LOCATION)
+ && e->goto_locus != locus)
return false;
}
@@ -362,7 +365,10 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted)
case GIMPLE_LABEL:
if (DECL_NONLOCAL (gimple_label_label (as_a <glabel *> (stmt))))
return false;
- if (optimize == 0 && gimple_location (stmt) != locus)
+ if (!optimize
+ && (gimple_has_location (stmt)
+ || LOCATION_LOCUS (locus) != UNKNOWN_LOCATION)
+ && gimple_location (stmt) != locus)
return false;
break;