summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-03-31 07:48:04 +0200
committerChristoph Muellner <christoph.muellner@theobroma-systems.com>2018-04-27 12:21:39 +0200
commit050f1d28b1de094b3112c0d5331322f109561713 (patch)
tree826286de111636a05eac17d47676af50de7d0747
parentaebbf1f37938b6143d62be77275cd1744551d6bb (diff)
Revert "2017-10-24 Richard Biener <rguenther@suse.de>"
This reverts commit 20496f0e660347d8d2d885dff2702182853602bd. The reason for the revert is, that it shows a significant performance slowdown on some benchmarks. After reverting the commit, the testcase (pr82697.c) still passes. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr82697.c23
-rw-r--r--gcc/tree-ssa-phiopt.c17
2 files changed, 1 insertions, 39 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr82697.c b/gcc/testsuite/gcc.dg/torture/pr82697.c
deleted file mode 100644
index 57da8a264b95..000000000000
--- a/gcc/testsuite/gcc.dg/torture/pr82697.c
+++ /dev/null
@@ -1,23 +0,0 @@
-/* { dg-do run } */
-
-__attribute__((noinline,noclone))
-void test(int *pi, long *pl, int f)
-{
- *pl = 0;
-
- *pi = 1;
-
- if (f)
- *pl = 2;
-}
-
-int main()
-{
- void *p = __builtin_malloc(sizeof (long));
-
- test(p, p, 0);
-
- if (*(int *)p != 1)
- __builtin_abort ();
- return 0;
-}
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index a97e0ccb058a..e47a9767c0dd 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -1813,24 +1813,9 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
gsi_remove (&gsi, true);
release_defs (assign);
- /* Make both store and load use alias-set zero as we have to
- deal with the case of the store being a conditional change
- of the dynamic type. */
- lhs = unshare_expr (lhs);
- tree *basep = &lhs;
- while (handled_component_p (*basep))
- basep = &TREE_OPERAND (*basep, 0);
- if (TREE_CODE (*basep) == MEM_REF
- || TREE_CODE (*basep) == TARGET_MEM_REF)
- TREE_OPERAND (*basep, 1)
- = fold_convert (ptr_type_node, TREE_OPERAND (*basep, 1));
- else
- *basep = build2 (MEM_REF, TREE_TYPE (*basep),
- build_fold_addr_expr (*basep),
- build_zero_cst (ptr_type_node));
-
/* 2) Insert a load from the memory of the store to the temporary
on the edge which did not contain the store. */
+ lhs = unshare_expr (lhs);
name = make_temp_ssa_name (TREE_TYPE (lhs), NULL, "cstore");
new_stmt = gimple_build_assign (name, lhs);
gimple_set_location (new_stmt, locus);