diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2016-10-10 18:39:41 +0000 |
---|---|---|
committer | William Schmidt <wschmidt@gcc.gnu.org> | 2016-10-10 18:39:41 +0000 |
commit | fbcdc43e3c209613bab6a58252eab3a6f436d7b1 (patch) | |
tree | b44bb2b6cb820d025263e0f0a3e07607b3faf9b2 /gcc | |
parent | e2be44770cb4cb5e81680d77b2f9ca350c0e346c (diff) | |
download | gcc-fbcdc43e3c209613bab6a58252eab3a6f436d7b1.zip gcc-fbcdc43e3c209613bab6a58252eab3a6f436d7b1.tar.gz gcc-fbcdc43e3c209613bab6a58252eab3a6f436d7b1.tar.bz2 |
re PR tree-optimization/77824 (unreachable code in SLSR GIMPLE pass)
2016-10-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
PR tree-optimization/77824
* gimple-ssa-strength-reduction.c (stmt_cost): Explicitly return
zero cost for copies.
(find_candidates_dom_walker::before_dom_children): Replace
MODIFY_EXPR with SSA_NAME.
(replace_mult_candidate): Likewise.
(replace_profitable_candidates): Likewise.
From-SVN: r240945
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/gimple-ssa-strength-reduction.c | 11 |
2 files changed, 17 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d5e330..1738bc7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2016-10-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com> + + PR tree-optimization/77824 + * gimple-ssa-strength-reduction.c (stmt_cost): Explicitly return + zero cost for copies. + (find_candidates_dom_walker::before_dom_children): Replace + MODIFY_EXPR with SSA_NAME. + (replace_mult_candidate): Likewise. + (replace_profitable_candidates): Likewise. + 2016-10-10 Andreas Krebbel <krebbel@linux.vnet.ibm.com> * config/s390/s390.h: Wrap more macros args in brackets and fix diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c index 7b14b91..b1a6602 100644 --- a/gcc/gimple-ssa-strength-reduction.c +++ b/gcc/gimple-ssa-strength-reduction.c @@ -688,6 +688,9 @@ stmt_cost (gimple *gs, bool speed) /* Note that we don't assign costs to copies that in most cases will go away. */ + case SSA_NAME: + return 0; + default: ; } @@ -1693,7 +1696,7 @@ find_candidates_dom_walker::before_dom_children (basic_block bb) gcc_fallthrough (); CASE_CONVERT: - case MODIFY_EXPR: + case SSA_NAME: case NEGATE_EXPR: rhs1 = gimple_assign_rhs1 (gs); if (TREE_CODE (rhs1) != SSA_NAME) @@ -1724,7 +1727,7 @@ find_candidates_dom_walker::before_dom_children (basic_block bb) slsr_process_cast (gs, rhs1, speed); break; - case MODIFY_EXPR: + case SSA_NAME: slsr_process_copy (gs, rhs1, speed); break; @@ -2010,7 +2013,7 @@ replace_mult_candidate (slsr_cand_t c, tree basis_name, widest_int bump) && bump.to_shwi () != HOST_WIDE_INT_MIN /* It is not useful to replace casts, copies, or adds of an SSA name and a constant. */ - && cand_code != MODIFY_EXPR + && cand_code != SSA_NAME && !CONVERT_EXPR_CODE_P (cand_code) && cand_code != PLUS_EXPR && cand_code != POINTER_PLUS_EXPR @@ -3445,7 +3448,7 @@ replace_profitable_candidates (slsr_cand_t c) to a cast or copy. */ if (i >= 0 && profitable_increment_p (i) - && orig_code != MODIFY_EXPR + && orig_code != SSA_NAME && !CONVERT_EXPR_CODE_P (orig_code)) { if (phi_dependent_cand_p (c)) |