Commit 35ecd408 by Richard Henderson Committed by Richard Henderson

tree-ssa-sccvn.c (vn_reference_lookup_3): Don't assume there are more…

tree-ssa-sccvn.c (vn_reference_lookup_3): Don't assume there are more VR->OPERANDS than LHS operands.

* tree-ssa-sccvn.c (vn_reference_lookup_3): Don't assume there are
        more VR->OPERANDS than LHS operands.  Free LHS before returning.

From-SVN: r151530
parent 3e5e84be
...@@ -89,6 +89,11 @@ ...@@ -89,6 +89,11 @@
(remove_from_deps): Also remove calls from (remove_from_deps): Also remove calls from
last_function_call_may_noreturn list. last_function_call_may_noreturn list.
2009-09-07 Richard Henderson <rth@redhat.com>
* tree-ssa-sccvn.c (vn_reference_lookup_3): Don't assume there are
more VR->OPERANDS than LHS operands. Free LHS before returning.
2009-09-07 Bernd Schmidt <bernd.schmidt@analog.com> 2009-09-07 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin.md (UNSPEC_VOLATILE_STALL): New constant. * config/bfin/bfin.md (UNSPEC_VOLATILE_STALL): New constant.
......
...@@ -1120,7 +1120,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_) ...@@ -1120,7 +1120,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
copy_reference_ops_from_ref (gimple_assign_lhs (def_stmt), &lhs); copy_reference_ops_from_ref (gimple_assign_lhs (def_stmt), &lhs);
i = VEC_length (vn_reference_op_s, vr->operands) - 1; i = VEC_length (vn_reference_op_s, vr->operands) - 1;
j = VEC_length (vn_reference_op_s, lhs) - 1; j = VEC_length (vn_reference_op_s, lhs) - 1;
while (j >= 0 while (j >= 0 && i >= 0
&& vn_reference_op_eq (VEC_index (vn_reference_op_s, && vn_reference_op_eq (VEC_index (vn_reference_op_s,
vr->operands, i), vr->operands, i),
VEC_index (vn_reference_op_s, lhs, j))) VEC_index (vn_reference_op_s, lhs, j)))
...@@ -1128,13 +1128,14 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_) ...@@ -1128,13 +1128,14 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_)
i--; i--;
j--; j--;
} }
VEC_free (vn_reference_op_s, heap, lhs);
/* i now points to the first additional op. /* i now points to the first additional op.
??? LHS may not be completely contained in VR, one or more ??? LHS may not be completely contained in VR, one or more
VIEW_CONVERT_EXPRs could be in its way. We could at least VIEW_CONVERT_EXPRs could be in its way. We could at least
try handling outermost VIEW_CONVERT_EXPRs. */ try handling outermost VIEW_CONVERT_EXPRs. */
if (j != -1) if (j != -1)
return (void *)-1; return (void *)-1;
VEC_free (vn_reference_op_s, heap, lhs);
/* Now re-write REF to be based on the rhs of the assignment. */ /* Now re-write REF to be based on the rhs of the assignment. */
copy_reference_ops_from_ref (gimple_assign_rhs1 (def_stmt), &rhs); copy_reference_ops_from_ref (gimple_assign_rhs1 (def_stmt), &rhs);
......
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