Commit 61514fe4 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/54647 (Segmentation fault in get_expr_value_id with -O2)

2012-09-21  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/54647
	* tree-ssa-pre.c (compute_avail): Do not put COND_EXPR
	or VEC_COND_EXPR into EXP_GEN again.

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

From-SVN: r191613
parent 0c105b72
2012-09-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54647
* tree-ssa-pre.c (compute_avail): Do not put COND_EXPR
or VEC_COND_EXPR into EXP_GEN again.
2012-09-21 Jakub Jelinek <jakub@redhat.com> 2012-09-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/54629 PR tree-optimization/54629
......
2012-09-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/54647
* g++.dg/torture/pr54647.C: New testcase.
2012-09-21 Marc Glisse <marc.glisse@inria.fr> 2012-09-21 Marc Glisse <marc.glisse@inria.fr>
PR c++/54427 PR c++/54427
......
// { dg-do compile }
class A
{
};
template <class type> struct D:A
{
type & operator[](int);
};
struct B
{
typedef D <int *>Row;
struct C
{
Row *row;
};
};
B::C a;
B::Row & b = *a.row;
void
fn1 ()
{
while (1)
b[0] = b[0] ? (int *) -1 : 0;
}
...@@ -3981,9 +3981,18 @@ compute_avail (void) ...@@ -3981,9 +3981,18 @@ compute_avail (void)
{ {
case VN_NARY: case VN_NARY:
{ {
enum tree_code code = gimple_assign_rhs_code (stmt);
vn_nary_op_t nary; vn_nary_op_t nary;
/* COND_EXPR and VEC_COND_EXPR are awkward in
that they contain an embedded complex expression.
Don't even try to shove those through PRE. */
if (code == COND_EXPR
|| code == VEC_COND_EXPR)
continue;
vn_nary_op_lookup_pieces (gimple_num_ops (stmt) - 1, vn_nary_op_lookup_pieces (gimple_num_ops (stmt) - 1,
gimple_assign_rhs_code (stmt), code,
gimple_expr_type (stmt), gimple_expr_type (stmt),
gimple_assign_rhs1_ptr (stmt), gimple_assign_rhs1_ptr (stmt),
&nary); &nary);
......
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