diff options
author | Martin Liska <mliska@suse.cz> | 2019-08-15 13:29:37 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-08-15 11:29:37 +0000 |
commit | bbedc1ae06a2b1e8ac5e687c754618d56e417d6c (patch) | |
tree | 13e46eea65e5dc729475dddb92d17a827f708733 /gcc | |
parent | 21c1e205664a2736741777ca34523d53b0edafa0 (diff) | |
download | gcc-bbedc1ae06a2b1e8ac5e687c754618d56e417d6c.zip gcc-bbedc1ae06a2b1e8ac5e687c754618d56e417d6c.tar.gz gcc-bbedc1ae06a2b1e8ac5e687c754618d56e417d6c.tar.bz2 |
Clean up dead condition for operators in DCE.
2019-08-15 Martin Liska <mliska@suse.cz>
* tree-ssa-dce.c (propagate_necessity): We can't reach now
operators with no arguments.
(eliminate_unnecessary_stmts): Likewise here.
From-SVN: r274529
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree-ssa-dce.c | 22 |
2 files changed, 12 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f43819b..49aabbe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-08-15 Martin Liska <mliska@suse.cz> + + * tree-ssa-dce.c (propagate_necessity): We can't reach now + operators with no arguments. + (eliminate_unnecessary_stmts): Likewise here. + 2019-08-15 Uroš Bizjak <ubizjak@gmail.com> * config/i386/i386-features.c (general_scalar_chain::convert_insn) diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index afb7bd9..80d5f5c 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -810,11 +810,6 @@ propagate_necessity (bool aggressive) if (is_delete_operator || gimple_call_builtin_p (stmt, BUILT_IN_FREE)) { - /* It can happen that a user delete operator has the pointer - argument optimized out already. */ - if (gimple_call_num_args (stmt) == 0) - continue; - tree ptr = gimple_call_arg (stmt, 0); gimple *def_stmt; tree def_callee; @@ -1328,18 +1323,13 @@ eliminate_unnecessary_stmts (void) || (is_gimple_call (stmt) && gimple_call_operator_delete_p (as_a <gcall *> (stmt))))) { - /* It can happen that a user delete operator has the pointer - argument optimized out already. */ - if (gimple_call_num_args (stmt) > 0) + tree ptr = gimple_call_arg (stmt, 0); + if (TREE_CODE (ptr) == SSA_NAME) { - tree ptr = gimple_call_arg (stmt, 0); - if (TREE_CODE (ptr) == SSA_NAME) - { - gimple *def_stmt = SSA_NAME_DEF_STMT (ptr); - if (!gimple_nop_p (def_stmt) - && !gimple_plf (def_stmt, STMT_NECESSARY)) - gimple_set_plf (stmt, STMT_NECESSARY, false); - } + gimple *def_stmt = SSA_NAME_DEF_STMT (ptr); + if (!gimple_nop_p (def_stmt) + && !gimple_plf (def_stmt, STMT_NECESSARY)) + gimple_set_plf (stmt, STMT_NECESSARY, false); } } |