summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-03 11:54:49 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2015-03-03 11:54:49 +0000
commit18526d26d0713217c806d0629a523e25b258b6a3 (patch)
tree5171a8e85f5a8f6e5aa6b698ed2026c29c5e2b5e /gcc/tree-ssa-dom.c
parentd0ed7b19c0ac3acd1f8806c2ab9526ed5740b439 (diff)
downloadgcc-18526d26d0713217c806d0629a523e25b258b6a3.tar.gz
PR tree-optimization/65241
* tree-ssa-dom.c (lookup_avail_expr): Only modify the avail_expr hash table if INSERT is true. PR tree-optimization/65241 * gcc.c-torture/compile/pr65241.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@221145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 096e4712675..d230ce1c7b3 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2649,19 +2649,22 @@ lookup_avail_expr (gimple stmt, bool insert)
&& walk_non_aliased_vuses (&ref, vuse2,
vuse_eq, NULL, NULL, vuse1) != NULL))
{
- struct expr_hash_elt *element2 = XNEW (struct expr_hash_elt);
- *element2 = element;
- element2->stamp = element2;
-
- /* Insert the expr into the hash by replacing the current
- entry and recording the value to restore in the
- aval_exprs_stack. */
- avail_exprs_stack.safe_push (std::make_pair (element2, *slot));
- *slot = element2;
- if (dump_file && (dump_flags & TDF_DETAILS))
+ if (insert)
{
- fprintf (dump_file, "2>>> ");
- print_expr_hash_elt (dump_file, *slot);
+ struct expr_hash_elt *element2 = XNEW (struct expr_hash_elt);
+ *element2 = element;
+ element2->stamp = element2;
+
+ /* Insert the expr into the hash by replacing the current
+ entry and recording the value to restore in the
+ avail_exprs_stack. */
+ avail_exprs_stack.safe_push (std::make_pair (element2, *slot));
+ *slot = element2;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "2>>> ");
+ print_expr_hash_elt (dump_file, *slot);
+ }
}
return NULL_TREE;
}