Commit a77af182 by Richard Biener Committed by Richard Biener

re PR ipa/78515 (ICE: in fold_binary_loc, at fold-const.c:8999 with -Os -mavx512bw)

2016-11-25  Richard Biener  <rguenther@suse.de>

	PR ipa/78515
	* ipa-prop.c (compute_complex_assign_jump_func): Properly identify
	unary, binary and single RHSs.
	* tree.def (BIT_INSERT_EXPR): Adjust tree code name.

	* gcc.dg/torture/pr78515.c: New testcase.

From-SVN: r242876
parent 3cae214f
2016-11-25 Richard Biener <rguenther@suse.de>
PR ipa/78515
* ipa-prop.c (compute_complex_assign_jump_func): Properly identify
unary, binary and single RHSs.
* tree.def (BIT_INSERT_EXPR): Adjust tree code name.
2016-11-25 Bin Cheng <bin.cheng@arm.com> 2016-11-25 Bin Cheng <bin.cheng@arm.com>
PR middle-end/78507 PR middle-end/78507
...@@ -1177,29 +1177,37 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi, ...@@ -1177,29 +1177,37 @@ compute_complex_assign_jump_func (struct ipa_func_body_info *fbi,
if (index >= 0) if (index >= 0)
{ {
tree op2 = gimple_assign_rhs2 (stmt); switch (gimple_assign_rhs_class (stmt))
if (op2)
{ {
if (!is_gimple_ip_invariant (op2) case GIMPLE_BINARY_RHS:
|| (TREE_CODE_CLASS (gimple_expr_code (stmt)) != tcc_comparison {
&& !useless_type_conversion_p (TREE_TYPE (name), tree op2 = gimple_assign_rhs2 (stmt);
TREE_TYPE (op1)))) if (!is_gimple_ip_invariant (op2)
return; || ((TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
!= tcc_comparison)
ipa_set_jf_arith_pass_through (jfunc, index, op2, && !useless_type_conversion_p (TREE_TYPE (name),
gimple_assign_rhs_code (stmt)); TREE_TYPE (op1))))
} return;
else if (gimple_assign_single_p (stmt))
{ ipa_set_jf_arith_pass_through (jfunc, index, op2,
bool agg_p = parm_ref_data_pass_through_p (fbi, index, call, tc_ssa); gimple_assign_rhs_code (stmt));
ipa_set_jf_simple_pass_through (jfunc, index, agg_p); break;
}
case GIMPLE_SINGLE_RHS:
{
bool agg_p = parm_ref_data_pass_through_p (fbi, index, call,
tc_ssa);
ipa_set_jf_simple_pass_through (jfunc, index, agg_p);
break;
}
case GIMPLE_UNARY_RHS:
if (is_gimple_assign (stmt2)
&& gimple_assign_rhs_class (stmt2) == GIMPLE_UNARY_RHS
&& ! CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt2)))
ipa_set_jf_unary_pass_through (jfunc, index,
gimple_assign_rhs_code (stmt2));
default:;
} }
else if (is_gimple_assign (stmt2)
&& (gimple_expr_code (stmt2) != NOP_EXPR)
&& (TREE_CODE_CLASS (gimple_expr_code (stmt2)) == tcc_unary))
ipa_set_jf_unary_pass_through (jfunc, index,
gimple_assign_rhs_code (stmt2));
return; return;
} }
......
2016-11-25 Richard Biener <rguenther@suse.de>
PR ipa/78515
* gcc.dg/torture/pr78515.c: New testcase.
2016-11-25 Paul Thomas <pault@gcc.gnu.org> 2016-11-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/78293 PR fortran/78293
......
/* { dg-do compile } */
/* { dg-additional-options "-mavx512bw" { target x86_64-*-* i?86-*-* } } */
typedef unsigned V __attribute__ ((vector_size (64)));
V g;
static V
baz (V u, V v)
{
g += u;
return v + g + 1;
}
static V
bar (V u)
{
u[0] = 0;
return baz(u, (V){});
}
V
foo ()
{
return (V){bar((V){})[0]};
}
...@@ -865,7 +865,7 @@ DEFTREECODE (FDESC_EXPR, "fdesc_expr", tcc_expression, 2) ...@@ -865,7 +865,7 @@ DEFTREECODE (FDESC_EXPR, "fdesc_expr", tcc_expression, 2)
introducing a quaternary operation. introducing a quaternary operation.
The replaced bits shall be fully inside the container. If the container The replaced bits shall be fully inside the container. If the container
is of vector type, then these bits shall be aligned with its elements. */ is of vector type, then these bits shall be aligned with its elements. */
DEFTREECODE (BIT_INSERT_EXPR, "bit_field_insert", tcc_expression, 3) DEFTREECODE (BIT_INSERT_EXPR, "bit_insert_expr", tcc_expression, 3)
/* Given two real or integer operands of the same type, /* Given two real or integer operands of the same type,
returns a complex value of the corresponding complex type. */ returns a complex value of the corresponding complex type. */
......
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