Commit 703c9ccd by Richard Biener Committed by Richard Biener

re PR tree-optimization/64995 (ICE in vn_reference_insert_pieces, at tree-ssa-sccvn.c:2341)

2015-02-10  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/64995
	* tree-ssa-sccvn.c (set_ssa_val_to): Assert that the
	value we use is final.
	(visit_reference_op_store): Always valueize op.
	(visit_use): Properly valueize vuses.

	* g++.dg/torture/pr64995.C: New testcase.

From-SVN: r220581
parent 696814ed
2015-02-10 Richard Biener <rguenther@suse.de> 2015-02-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/64995
* tree-ssa-sccvn.c (set_ssa_val_to): Assert that the
value we use is final.
(visit_reference_op_store): Always valueize op.
(visit_use): Properly valueize vuses.
2015-02-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/64909 PR tree-optimization/64909
* tree-vect-loop.c (vect_estimate_min_profitable_iters): Properly * tree-vect-loop.c (vect_estimate_min_profitable_iters): Properly
pass a scalar-stmt count estimate to the cost model. pass a scalar-stmt count estimate to the cost model.
......
2015-02-10 Richard Biener <rguenther@suse.de> 2015-02-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/64995
* g++.dg/torture/pr64995.C: New testcase.
2015-02-10 Richard Biener <rguenther@suse.de>
PR tree-optimization/64909 PR tree-optimization/64909
* gcc.dg/vect/costmodel/x86_64/costmodel-pr64909.c: New testcase. * gcc.dg/vect/costmodel/x86_64/costmodel-pr64909.c: New testcase.
......
// { dg-do compile }
extern "C" double acos(double);
class A {
public:
double mY, mZ;
A(double, double);
double m_fn1(A *);
int *m_fn2();
};
double a;
A *b;
A::A(double, double) : mY(), mZ() {}
double A::m_fn1(A *) { return mY * mZ; }
inline int *A::m_fn2() {
mZ = 0;
double c = m_fn1(this);
a = acos(c);
double d = m_fn1(b);
acos(d);
}
void passTime() {
A e(0, 1);
e.m_fn2();
}
...@@ -1606,7 +1606,7 @@ vn_reference_lookup_or_insert_for_pieces (tree vuse, ...@@ -1606,7 +1606,7 @@ vn_reference_lookup_or_insert_for_pieces (tree vuse,
va_heap> operands, va_heap> operands,
tree value) tree value)
{ {
struct vn_reference_s vr1; vn_reference_s vr1;
vn_reference_t result; vn_reference_t result;
unsigned value_id; unsigned value_id;
vr1.vuse = vuse; vr1.vuse = vuse;
...@@ -2816,7 +2816,8 @@ set_ssa_val_to (tree from, tree to) ...@@ -2816,7 +2816,8 @@ set_ssa_val_to (tree from, tree to)
} }
gcc_assert (to != NULL_TREE gcc_assert (to != NULL_TREE
&& (TREE_CODE (to) == SSA_NAME && ((TREE_CODE (to) == SSA_NAME
&& (to == from || SSA_VAL (to) == to))
|| is_gimple_min_invariant (to))); || is_gimple_min_invariant (to)));
if (from != to) if (from != to)
...@@ -3122,6 +3123,9 @@ visit_reference_op_store (tree lhs, tree op, gimple stmt) ...@@ -3122,6 +3123,9 @@ visit_reference_op_store (tree lhs, tree op, gimple stmt)
tree vuse = gimple_vuse (stmt); tree vuse = gimple_vuse (stmt);
tree vdef = gimple_vdef (stmt); tree vdef = gimple_vdef (stmt);
if (TREE_CODE (op) == SSA_NAME)
op = SSA_VAL (op);
/* First we want to lookup using the *vuses* from the store and see /* First we want to lookup using the *vuses* from the store and see
if there the last store to this location with the same address if there the last store to this location with the same address
had the same value. had the same value.
...@@ -3144,8 +3148,6 @@ visit_reference_op_store (tree lhs, tree op, gimple stmt) ...@@ -3144,8 +3148,6 @@ visit_reference_op_store (tree lhs, tree op, gimple stmt)
{ {
if (TREE_CODE (result) == SSA_NAME) if (TREE_CODE (result) == SSA_NAME)
result = SSA_VAL (result); result = SSA_VAL (result);
if (TREE_CODE (op) == SSA_NAME)
op = SSA_VAL (op);
resultsame = expressions_equal_p (result, op); resultsame = expressions_equal_p (result, op);
} }
...@@ -3722,7 +3724,7 @@ visit_use (tree use) ...@@ -3722,7 +3724,7 @@ visit_use (tree use)
changed = set_ssa_val_to (lhs, simplified); changed = set_ssa_val_to (lhs, simplified);
if (gimple_vdef (stmt)) if (gimple_vdef (stmt))
changed |= set_ssa_val_to (gimple_vdef (stmt), changed |= set_ssa_val_to (gimple_vdef (stmt),
gimple_vuse (stmt)); SSA_VAL (gimple_vuse (stmt)));
goto done; goto done;
} }
else if (simplified else if (simplified
...@@ -3731,7 +3733,7 @@ visit_use (tree use) ...@@ -3731,7 +3733,7 @@ visit_use (tree use)
changed = visit_copy (lhs, simplified); changed = visit_copy (lhs, simplified);
if (gimple_vdef (stmt)) if (gimple_vdef (stmt))
changed |= set_ssa_val_to (gimple_vdef (stmt), changed |= set_ssa_val_to (gimple_vdef (stmt),
gimple_vuse (stmt)); SSA_VAL (gimple_vuse (stmt)));
goto done; goto done;
} }
else else
......
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