diff options
author | Richard Biener <rguenther@suse.de> | 2021-05-04 09:18:11 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-05-04 12:31:50 +0200 |
commit | 2326627eb19d8c21251fd60479f1a190621c475b (patch) | |
tree | 68e2dd05cbc8e916e76dd4447f45dc69ed5c7756 /gcc/tree-ssa-dse.c | |
parent | 00d8545d7058d2fcac6ef7203773f17f3b517121 (diff) | |
download | gcc-2326627eb19d8c21251fd60479f1a190621c475b.zip gcc-2326627eb19d8c21251fd60479f1a190621c475b.tar.gz gcc-2326627eb19d8c21251fd60479f1a190621c475b.tar.bz2 |
tree-optimization/100398 - avoid DSE of control flow stmt
The following makes sure to preserve control altering stmts
when removing trivially dead stmts in DSE.
2021-05-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/100398
* tree-ssa-dse.c (pass_dse::execute): Preserve control
altering stmts.
* gcc.dg/torture/pr100398.c: New testcase.
Diffstat (limited to 'gcc/tree-ssa-dse.c')
-rw-r--r-- | gcc/tree-ssa-dse.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index dfa6d31..d7cf747 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -1219,6 +1219,7 @@ pass_dse::execute (function *fun) dead SSA defs. */ if (has_zero_uses (DEF_FROM_PTR (def_p)) && !gimple_has_side_effects (stmt) + && !is_ctrl_altering_stmt (stmt) && !stmt_unremovable_because_of_non_call_eh_p (cfun, stmt)) { if (dump_file && (dump_flags & TDF_DETAILS)) |