Commit ca0e1607 by Richard Biener Committed by Richard Biener

re PR bootstrap/77768 (LTO/PGO -O3 bootstrap broken: tree-vrp.c:11053:0:…

re PR bootstrap/77768 (LTO/PGO -O3 bootstrap broken: tree-vrp.c:11053:0: internal compiler error: Segmentation fault)

2016-09-29  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/77768
	* tree-ssa-sccvn.c (visit_reference_op_store): Properly deal
	with stores to a place we know has a constant value.

From-SVN: r240610
parent 67487878
2016-09-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/77768
* tree-ssa-sccvn.c (visit_reference_op_store): Properly deal
with stores to a place we know has a constant value.
2016-09-29 Alan Modra <amodra@gmail.com> 2016-09-29 Alan Modra <amodra@gmail.com>
* config/rs6000/sysv4.opt (mgnu-attribute): New option. * config/rs6000/sysv4.opt (mgnu-attribute): New option.
......
...@@ -3575,7 +3575,7 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt) ...@@ -3575,7 +3575,7 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt)
{ {
bool changed = false; bool changed = false;
vn_reference_t vnresult = NULL; vn_reference_t vnresult = NULL;
tree result, assign; tree assign;
bool resultsame = false; bool resultsame = false;
tree vuse = gimple_vuse (stmt); tree vuse = gimple_vuse (stmt);
tree vdef = gimple_vdef (stmt); tree vdef = gimple_vdef (stmt);
...@@ -3599,9 +3599,11 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt) ...@@ -3599,9 +3599,11 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt)
Otherwise, the vdefs for the store are used when inserting into Otherwise, the vdefs for the store are used when inserting into
the table, since the store generates a new memory state. */ the table, since the store generates a new memory state. */
result = vn_reference_lookup (lhs, vuse, VN_NOWALK, &vnresult, false); vn_reference_lookup (lhs, vuse, VN_NOWALK, &vnresult, false);
if (result) if (vnresult
&& vnresult->result)
{ {
tree result = vnresult->result;
if (TREE_CODE (result) == SSA_NAME) if (TREE_CODE (result) == SSA_NAME)
result = SSA_VAL (result); result = SSA_VAL (result);
resultsame = expressions_equal_p (result, op); resultsame = expressions_equal_p (result, op);
...@@ -3616,10 +3618,11 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt) ...@@ -3616,10 +3618,11 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt)
} }
} }
if ((!result || !resultsame) if (!resultsame)
{
/* Only perform the following when being called from PRE /* Only perform the following when being called from PRE
which embeds tail merging. */ which embeds tail merging. */
&& default_vn_walk_kind == VN_WALK) if (default_vn_walk_kind == VN_WALK)
{ {
assign = build2 (MODIFY_EXPR, TREE_TYPE (lhs), lhs, op); assign = build2 (MODIFY_EXPR, TREE_TYPE (lhs), lhs, op);
vn_reference_lookup (assign, vuse, VN_NOWALK, &vnresult, false); vn_reference_lookup (assign, vuse, VN_NOWALK, &vnresult, false);
...@@ -3630,8 +3633,6 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt) ...@@ -3630,8 +3633,6 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt)
} }
} }
if (!result || !resultsame)
{
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
{ {
fprintf (dump_file, "No store match\n"); fprintf (dump_file, "No store match\n");
...@@ -3644,9 +3645,7 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt) ...@@ -3644,9 +3645,7 @@ visit_reference_op_store (tree lhs, tree op, gimple *stmt)
/* Have to set value numbers before insert, since insert is /* Have to set value numbers before insert, since insert is
going to valueize the references in-place. */ going to valueize the references in-place. */
if (vdef) if (vdef)
{
changed |= set_ssa_val_to (vdef, vdef); changed |= set_ssa_val_to (vdef, vdef);
}
/* Do not insert structure copies into the tables. */ /* Do not insert structure copies into the tables. */
if (is_gimple_min_invariant (op) if (is_gimple_min_invariant (op)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment