aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2020-06-17 07:50:57 -0400
committerAldy Hernandez <aldyh@redhat.com>2020-06-17 07:50:57 -0400
commitb9e67f2840ce0d8859d96e7f8df8fe9584af5eba (patch)
treeed3b7284ff15c802583f6409b9c71b3739642d15 /gcc/tree-if-conv.c
parent1957047ed1c94bf17cf993a2b1866965f493ba87 (diff)
parent56638b9b1853666f575928f8baf17f70e4ed3517 (diff)
downloadgcc-b9e67f2840ce0d8859d96e7f8df8fe9584af5eba.zip
gcc-b9e67f2840ce0d8859d96e7f8df8fe9584af5eba.tar.gz
gcc-b9e67f2840ce0d8859d96e7f8df8fe9584af5eba.tar.bz2
Merge from trunk at:
commit 56638b9b1853666f575928f8baf17f70e4ed3517 Author: GCC Administrator <gccadmin@gcc.gnu.org> Date: Wed Jun 17 00:16:36 2020 +0000 Daily bump.
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 8d24c18..fc894eb 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -2917,9 +2917,12 @@ ifcvt_local_dce (class loop *loop)
for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
stmt = gsi_stmt (gsi);
- if (gimple_store_p (stmt)
- || gimple_assign_load_p (stmt)
- || is_gimple_debug (stmt))
+ if (is_gimple_debug (stmt))
+ {
+ gimple_set_plf (stmt, GF_PLF_2, true);
+ continue;
+ }
+ if (gimple_store_p (stmt) || gimple_assign_load_p (stmt))
{
gimple_set_plf (stmt, GF_PLF_2, true);
worklist.safe_push (stmt);
@@ -2940,7 +2943,7 @@ ifcvt_local_dce (class loop *loop)
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, lhs)
{
stmt1 = USE_STMT (use_p);
- if (gimple_bb (stmt1) != bb)
+ if (!is_gimple_debug (stmt1) && gimple_bb (stmt1) != bb)
{
gimple_set_plf (stmt, GF_PLF_2, true);
worklist.safe_push (stmt);
@@ -2963,17 +2966,18 @@ ifcvt_local_dce (class loop *loop)
if (TREE_CODE (use) != SSA_NAME)
continue;
stmt1 = SSA_NAME_DEF_STMT (use);
- if (gimple_bb (stmt1) != bb
- || gimple_plf (stmt1, GF_PLF_2))
+ if (gimple_bb (stmt1) != bb || gimple_plf (stmt1, GF_PLF_2))
continue;
gimple_set_plf (stmt1, GF_PLF_2, true);
worklist.safe_push (stmt1);
}
}
/* Delete dead statements. */
- gsi = gsi_start_bb (bb);
+ gsi = gsi_last_bb (bb);
while (!gsi_end_p (gsi))
{
+ gimple_stmt_iterator gsiprev = gsi;
+ gsi_prev (&gsiprev);
stmt = gsi_stmt (gsi);
if (gimple_store_p (stmt))
{
@@ -2984,14 +2988,13 @@ ifcvt_local_dce (class loop *loop)
if (dse_classify_store (&write, stmt, false, NULL, NULL, latch_vdef)
== DSE_STORE_DEAD)
delete_dead_or_redundant_assignment (&gsi, "dead");
- else
- gsi_next (&gsi);
+ gsi = gsiprev;
continue;
}
if (gimple_plf (stmt, GF_PLF_2))
{
- gsi_next (&gsi);
+ gsi = gsiprev;
continue;
}
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -3001,6 +3004,7 @@ ifcvt_local_dce (class loop *loop)
}
gsi_remove (&gsi, true);
release_defs (stmt);
+ gsi = gsiprev;
}
}