summaryrefslogtreecommitdiff
path: root/gcc/tree-predcom.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-14 14:33:54 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2017-08-14 14:33:54 +0000
commit5321ffedee1b4e05b7fa56cab64c595516fd9533 (patch)
treeffda4ecce65bb72e54a07d8ed2c09288fa207b43 /gcc/tree-predcom.c
parentb31856d3ac23cf3dab1e95cb96230dc81564c84a (diff)
downloadgcc-hsa.tar.gz
Merged trunk revision 251080 into the hsa branchhsa
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/hsa@251093 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-predcom.c')
-rw-r--r--gcc/tree-predcom.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index a4011bf4698..e7b10cb390f 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -1069,7 +1069,9 @@ add_ref_to_chain (chain_p chain, dref ref)
chain->has_max_use_after = false;
}
- if (ref->distance == chain->length
+ /* Don't set the flag for store-store chain since there is no use. */
+ if (chain->type != CT_STORE_STORE
+ && ref->distance == chain->length
&& ref->pos > root->pos)
chain->has_max_use_after = true;
@@ -2938,7 +2940,7 @@ prepare_finalizers_chain (struct loop *loop, chain_p chain)
if (TREE_CODE (niters) != INTEGER_CST && TREE_CODE (niters) != SSA_NAME)
{
- niters = copy_node (niters);
+ niters = unshare_expr (niters);
niters = force_gimple_operand (niters, &stmts, true, NULL);
if (stmts)
{
@@ -2981,11 +2983,11 @@ prepare_finalizers (struct loop *loop, vec<chain_p> chains)
if (prepare_finalizers_chain (loop, chain))
{
i++;
- /* We don't corrupt loop closed ssa form for store elimination
- chain if eliminated stores only store loop invariant values
- into memory. */
- if (!chain->inv_store_elimination)
- loop_closed_ssa |= (!chain->inv_store_elimination);
+ /* Be conservative, assume loop closed ssa form is corrupted
+ by store-store chain. Though it's not always the case if
+ eliminated stores only store loop invariant values into
+ memory. */
+ loop_closed_ssa = true;
}
else
{