Commit 1a2d7586 by Eric Botcazou Committed by Eric Botcazou

re PR middle-end/68215 (FAIL: c-c++-common/opaque-vector.c -std=c++11 (internal compiler error))

	PR middle-end/68215
	* tree-vect-generic.c (tree_vec_extract): Remove GSI parameter.
	Do not gimplify the result.
	(do_unop): Adjust call to tree_vec_extract.
	(do_binop): Likewise.
	(do_compare): Likewise.
	(do_plus_minus): Likewise.
	(do_negate): Likewise.
	(expand_vector_condition): Likewise.
	(do_cond): Likewise.

From-SVN: r231575
parent f3d7dd52
2015-12-11 Eric Botcazou <ebotcazou@adacore.com>
PR middle-end/68215
* tree-vect-generic.c (tree_vec_extract): Remove GSI parameter.
Do not gimplify the result.
(do_unop): Adjust call to tree_vec_extract.
(do_binop): Likewise.
(do_compare): Likewise.
(do_plus_minus): Likewise.
(do_negate): Likewise.
(expand_vector_condition): Likewise.
(do_cond): Likewise.
2015-12-11 Nathan Sidwell <nathan@acm.org> 2015-12-11 Nathan Sidwell <nathan@acm.org>
* config/nvptx/nvptx.h (RETURN_ADDR_REGNO): Delete. * config/nvptx/nvptx.h (RETURN_ADDR_REGNO): Delete.
...@@ -19,7 +32,6 @@ ...@@ -19,7 +32,6 @@
PR target/26427 PR target/26427
PR target/33120 PR target/33120
PR testsuite/35710 PR testsuite/35710
* config/darwin.c (darwin_use_anchors_for_symbol_p): Fix indention and * config/darwin.c (darwin_use_anchors_for_symbol_p): Fix indention and
trailing whitespace. trailing whitespace.
...@@ -103,8 +103,7 @@ typedef tree (*elem_op_func) (gimple_stmt_iterator *, ...@@ -103,8 +103,7 @@ typedef tree (*elem_op_func) (gimple_stmt_iterator *,
tree); tree);
static inline tree static inline tree
tree_vec_extract (gimple_stmt_iterator *gsi, tree type, tree_vec_extract (tree type, tree t, tree bitsize, tree bitpos)
tree t, tree bitsize, tree bitpos)
{ {
if (TREE_CODE (t) == SSA_NAME) if (TREE_CODE (t) == SSA_NAME)
{ {
...@@ -115,22 +114,21 @@ tree_vec_extract (gimple_stmt_iterator *gsi, tree type, ...@@ -115,22 +114,21 @@ tree_vec_extract (gimple_stmt_iterator *gsi, tree type,
&& gimple_assign_rhs_code (def_stmt) == CONSTRUCTOR))) && gimple_assign_rhs_code (def_stmt) == CONSTRUCTOR)))
t = gimple_assign_rhs1 (def_stmt); t = gimple_assign_rhs1 (def_stmt);
} }
if (bitpos) if (bitpos)
{ {
if (TREE_CODE (type) == BOOLEAN_TYPE) if (TREE_CODE (type) == BOOLEAN_TYPE)
{ {
tree itype tree itype
= build_nonstandard_integer_type (tree_to_uhwi (bitsize), 0); = build_nonstandard_integer_type (tree_to_uhwi (bitsize), 0);
tree field = gimplify_build3 (gsi, BIT_FIELD_REF, itype, t, tree field = fold_build3 (BIT_FIELD_REF, itype, t, bitsize, bitpos);
bitsize, bitpos); return fold_build2 (NE_EXPR, type, field, build_zero_cst (itype));
return gimplify_build2 (gsi, NE_EXPR, type, field,
build_zero_cst (itype));
} }
else
return gimplify_build3 (gsi, BIT_FIELD_REF, type, t, bitsize, bitpos); return fold_build3 (BIT_FIELD_REF, type, t, bitsize, bitpos);
} }
else
return gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t); return fold_build1 (VIEW_CONVERT_EXPR, type, t);
} }
static tree static tree
...@@ -138,7 +136,7 @@ do_unop (gimple_stmt_iterator *gsi, tree inner_type, tree a, ...@@ -138,7 +136,7 @@ do_unop (gimple_stmt_iterator *gsi, tree inner_type, tree a,
tree b ATTRIBUTE_UNUSED, tree bitpos, tree bitsize, tree b ATTRIBUTE_UNUSED, tree bitpos, tree bitsize,
enum tree_code code, tree type ATTRIBUTE_UNUSED) enum tree_code code, tree type ATTRIBUTE_UNUSED)
{ {
a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos); a = tree_vec_extract (inner_type, a, bitsize, bitpos);
return gimplify_build1 (gsi, code, inner_type, a); return gimplify_build1 (gsi, code, inner_type, a);
} }
...@@ -148,9 +146,9 @@ do_binop (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b, ...@@ -148,9 +146,9 @@ do_binop (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree type ATTRIBUTE_UNUSED) tree type ATTRIBUTE_UNUSED)
{ {
if (TREE_CODE (TREE_TYPE (a)) == VECTOR_TYPE) if (TREE_CODE (TREE_TYPE (a)) == VECTOR_TYPE)
a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos); a = tree_vec_extract (inner_type, a, bitsize, bitpos);
if (TREE_CODE (TREE_TYPE (b)) == VECTOR_TYPE) if (TREE_CODE (TREE_TYPE (b)) == VECTOR_TYPE)
b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos); b = tree_vec_extract (inner_type, b, bitsize, bitpos);
return gimplify_build2 (gsi, code, inner_type, a, b); return gimplify_build2 (gsi, code, inner_type, a, b);
} }
...@@ -169,8 +167,8 @@ do_compare (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b, ...@@ -169,8 +167,8 @@ do_compare (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree cst_true = build_all_ones_cst (stype); tree cst_true = build_all_ones_cst (stype);
tree cmp; tree cmp;
a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos); a = tree_vec_extract (inner_type, a, bitsize, bitpos);
b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos); b = tree_vec_extract (inner_type, b, bitsize, bitpos);
cmp = build2 (code, boolean_type_node, a, b); cmp = build2 (code, boolean_type_node, a, b);
return gimplify_build3 (gsi, COND_EXPR, stype, cmp, cst_true, cst_false); return gimplify_build3 (gsi, COND_EXPR, stype, cmp, cst_true, cst_false);
...@@ -202,8 +200,8 @@ do_plus_minus (gimple_stmt_iterator *gsi, tree word_type, tree a, tree b, ...@@ -202,8 +200,8 @@ do_plus_minus (gimple_stmt_iterator *gsi, tree word_type, tree a, tree b,
low_bits = build_replicated_const (word_type, inner_type, max >> 1); low_bits = build_replicated_const (word_type, inner_type, max >> 1);
high_bits = build_replicated_const (word_type, inner_type, max & ~(max >> 1)); high_bits = build_replicated_const (word_type, inner_type, max & ~(max >> 1));
a = tree_vec_extract (gsi, word_type, a, bitsize, bitpos); a = tree_vec_extract (word_type, a, bitsize, bitpos);
b = tree_vec_extract (gsi, word_type, b, bitsize, bitpos); b = tree_vec_extract (word_type, b, bitsize, bitpos);
signs = gimplify_build2 (gsi, BIT_XOR_EXPR, word_type, a, b); signs = gimplify_build2 (gsi, BIT_XOR_EXPR, word_type, a, b);
b_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, b, low_bits); b_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, b, low_bits);
...@@ -235,7 +233,7 @@ do_negate (gimple_stmt_iterator *gsi, tree word_type, tree b, ...@@ -235,7 +233,7 @@ do_negate (gimple_stmt_iterator *gsi, tree word_type, tree b,
low_bits = build_replicated_const (word_type, inner_type, max >> 1); low_bits = build_replicated_const (word_type, inner_type, max >> 1);
high_bits = build_replicated_const (word_type, inner_type, max & ~(max >> 1)); high_bits = build_replicated_const (word_type, inner_type, max & ~(max >> 1));
b = tree_vec_extract (gsi, word_type, b, bitsize, bitpos); b = tree_vec_extract (word_type, b, bitsize, bitpos);
b_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, b, low_bits); b_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, b, low_bits);
signs = gimplify_build1 (gsi, BIT_NOT_EXPR, word_type, b); signs = gimplify_build1 (gsi, BIT_NOT_EXPR, word_type, b);
...@@ -891,16 +889,16 @@ expand_vector_condition (gimple_stmt_iterator *gsi) ...@@ -891,16 +889,16 @@ expand_vector_condition (gimple_stmt_iterator *gsi)
i++, index = int_const_binop (PLUS_EXPR, index, width)) i++, index = int_const_binop (PLUS_EXPR, index, width))
{ {
tree aa, result; tree aa, result;
tree bb = tree_vec_extract (gsi, inner_type, b, width, index); tree bb = tree_vec_extract (inner_type, b, width, index);
tree cc = tree_vec_extract (gsi, inner_type, c, width, index); tree cc = tree_vec_extract (inner_type, c, width, index);
if (a_is_comparison) if (a_is_comparison)
{ {
tree aa1 = tree_vec_extract (gsi, comp_inner_type, a1, width, index); tree aa1 = tree_vec_extract (comp_inner_type, a1, width, index);
tree aa2 = tree_vec_extract (gsi, comp_inner_type, a2, width, index); tree aa2 = tree_vec_extract (comp_inner_type, a2, width, index);
aa = build2 (TREE_CODE (a), cond_type, aa1, aa2); aa = build2 (TREE_CODE (a), cond_type, aa1, aa2);
} }
else else
aa = tree_vec_extract (gsi, cond_type, a, width, index); aa = tree_vec_extract (cond_type, a, width, index);
result = gimplify_build3 (gsi, COND_EXPR, inner_type, aa, bb, cc); result = gimplify_build3 (gsi, COND_EXPR, inner_type, aa, bb, cc);
constructor_elt ce = {NULL_TREE, result}; constructor_elt ce = {NULL_TREE, result};
v->quick_push (ce); v->quick_push (ce);
...@@ -1449,9 +1447,9 @@ do_cond (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b, ...@@ -1449,9 +1447,9 @@ do_cond (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree type ATTRIBUTE_UNUSED) tree type ATTRIBUTE_UNUSED)
{ {
if (TREE_CODE (TREE_TYPE (a)) == VECTOR_TYPE) if (TREE_CODE (TREE_TYPE (a)) == VECTOR_TYPE)
a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos); a = tree_vec_extract (inner_type, a, bitsize, bitpos);
if (TREE_CODE (TREE_TYPE (b)) == VECTOR_TYPE) if (TREE_CODE (TREE_TYPE (b)) == VECTOR_TYPE)
b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos); b = tree_vec_extract (inner_type, b, bitsize, bitpos);
tree cond = gimple_assign_rhs1 (gsi_stmt (*gsi)); tree cond = gimple_assign_rhs1 (gsi_stmt (*gsi));
return gimplify_build3 (gsi, code, inner_type, unshare_expr (cond), a, b); return gimplify_build3 (gsi, code, inner_type, unshare_expr (cond), a, b);
} }
......
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