diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-12 23:09:09 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-12 23:09:09 +0000 |
commit | 2073fe3ebac2d922b5e1081df9be1f85ca21b437 (patch) | |
tree | 4e1d17e7b892481344d86fd6de1da8db9cbc861a | |
parent | af2db0a9a6f80bf145c9c36563ef9a0e4ee454da (diff) | |
download | gcc-2073fe3ebac2d922b5e1081df9be1f85ca21b437.tar.gz |
* gimple-ssa-isolate-paths.c (check_loadstore): Mark discovered
memory references as volatile.
(insert_trap_and_remove_trailing_statements): Fix comment.
* gcc.dg/tree-ssa/isolate-1.c: Update expected output.
* gcc.dg/tree-ssa/isolate-5.c: Verify the load survives through
the SSA optimizers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204722 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple-ssa-isolate-paths.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c | 6 |
5 files changed, 24 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fd9ca26062a..4b7209ec745 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-11-12 Jeff Law <law@redhat.com> + + * gimple-ssa-isolate-paths.c (check_loadstore): Mark discovered + memory references as volatile. + (insert_trap_and_remove_trailing_statements): Fix comment. + 2013-11-12 Vladimir Makarov <vmakarov@redhat.com> PR other/58712 diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c index 48ab6049e4e..2d8f176c4b9 100644 --- a/gcc/gimple-ssa-isolate-paths.c +++ b/gcc/gimple-ssa-isolate-paths.c @@ -51,7 +51,12 @@ check_loadstore (gimple stmt ATTRIBUTE_UNUSED, tree op, void *data) { if ((TREE_CODE (op) == MEM_REF || TREE_CODE (op) == TARGET_MEM_REF) && operand_equal_p (TREE_OPERAND (op, 0), (tree)data, 0)) - return true; + { + TREE_THIS_VOLATILE (op) = 1; + TREE_SIDE_EFFECTS (op) = 1; + update_stmt (stmt); + return true; + } return false; } @@ -64,7 +69,7 @@ insert_trap_and_remove_trailing_statements (gimple_stmt_iterator *si_p, tree op) code that wishes to catch the signal can do so. If the dereference is a load, then there's nothing to do as the - LHS will be a throw-away SSA_NAME and the LHS is the NULL dereference. + LHS will be a throw-away SSA_NAME and the RHS is the NULL dereference. If the dereference is a store and we can easily transform the RHS, then simplify the RHS to enable more DCE. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a8ac6f8acc4..e3460efad24 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-11-12 Jeff Law <law@redhat.com> + + * gcc.dg/tree-ssa/isolate-1.c: Update expected output. + * gcc.dg/tree-ssa/isolate-5.c: Verify the load survives through + the SSA optimizers. + 2013-11-12 Michael Meissner <meissner@linux.vnet.ibm.com> PR target/59054 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c b/gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c index 33745baf2f8..f1f3101d3d2 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/isolate-1.c @@ -50,7 +50,7 @@ d_type (struct d_info *di) and finally that we set the RHS of the store to zero. */ /* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */ /* { dg-final { scan-tree-dump-times "->type = 42" 1 "isolate-paths"} } */ -/* { dg-final { scan-tree-dump-times "->type = 0" 1 "isolate-paths"} } */ +/* { dg-final { scan-tree-dump-times "->type ={v} 0" 1 "isolate-paths"} } */ /* { dg-final { scan-tree-dump-times "->zzz" 1 "isolate-paths"} } */ /* { dg-final { cleanup-tree-dump "isolate-paths" } } */ diff --git a/gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c b/gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c index a70871eba00..ee587d2320d 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/isolate-5.c @@ -1,6 +1,6 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -fdump-tree-isolate-paths" } */ +/* { dg-options "-O2 -fdump-tree-isolate-paths -fdump-tree-optimized" } */ struct demangle_component @@ -51,9 +51,11 @@ d_type (struct d_info *di) We leave the 0->type in the IL, so expect to see ->type twice. */ /* { dg-final { scan-tree-dump-times "__builtin_trap" 1 "isolate-paths"} } */ /* { dg-final { scan-tree-dump-times "->type" 2 "isolate-paths"} } */ +/* { dg-final { scan-tree-dump-times "->type" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "\\.type" 1 "optimized"} } */ /* { dg-final { scan-tree-dump-times "->zzz" 1 "isolate-paths"} } */ /* { dg-final { cleanup-tree-dump "isolate-paths" } } */ - +/* { dg-final { cleanup-tree-dump "optimized-paths" } } */ |