2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-15 15:21:24 +08:00

re PR tree-optimization/70177 (ICE in extract_ops_from_tree starting with r233660)

PR tree-optimization/70177
	* gimple-expr.h (extract_ops_from_tree_1): Renamed to ...
	(extract_ops_from_tree): ... this.  In the 2 argument
	overload remove _1 suffix.
	* gimple-expr.c (extract_ops_from_tree_1): Renamed to ...
	(extract_ops_from_tree): ... this.
	* gimple.c (gimple_build_assign, gimple_assign_set_rhs_from_tree):
	Adjust callers.
	* tree-ssa-loop-niter.c (derive_constant_upper_bound): Likewise.
	* tree-ssa-forwprop.c (defcodefor_name): Call 3 operand
	extract_ops_from_tree instead of 2 operand one.

	* gcc.dg/pr70177.c: New test.

From-SVN: r234140
This commit is contained in:
Jakub Jelinek 2016-03-11 13:28:50 +01:00 committed by Jakub Jelinek
parent 07350627b6
commit d1e2bb2d01
8 changed files with 46 additions and 12 deletions

@ -1,3 +1,17 @@
2016-03-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/70177
* gimple-expr.h (extract_ops_from_tree_1): Renamed to ...
(extract_ops_from_tree): ... this. In the 2 argument
overload remove _1 suffix.
* gimple-expr.c (extract_ops_from_tree_1): Renamed to ...
(extract_ops_from_tree): ... this.
* gimple.c (gimple_build_assign, gimple_assign_set_rhs_from_tree):
Adjust callers.
* tree-ssa-loop-niter.c (derive_constant_upper_bound): Likewise.
* tree-ssa-forwprop.c (defcodefor_name): Call 3 operand
extract_ops_from_tree instead of 2 operand one.
2016-03-11 Alan Lawrence <alan.lawrence@arm.com>
PR tree-optimization/70013

@ -519,8 +519,8 @@ create_tmp_reg_fn (struct function *fn, tree type, const char *prefix)
*OP1_P, *OP2_P and *OP3_P respectively. */
void
extract_ops_from_tree_1 (tree expr, enum tree_code *subcode_p, tree *op1_p,
tree *op2_p, tree *op3_p)
extract_ops_from_tree (tree expr, enum tree_code *subcode_p, tree *op1_p,
tree *op2_p, tree *op3_p)
{
enum gimple_rhs_class grhs_class;

@ -35,8 +35,8 @@ extern tree create_tmp_reg (tree, const char * = NULL);
extern tree create_tmp_reg_fn (struct function *, tree, const char *);
extern void extract_ops_from_tree_1 (tree, enum tree_code *, tree *, tree *,
tree *);
extern void extract_ops_from_tree (tree, enum tree_code *, tree *, tree *,
tree *);
extern void gimple_cond_get_ops_from_tree (tree, enum tree_code *, tree *,
tree *);
extern bool is_gimple_lvalue (tree);
@ -146,15 +146,15 @@ is_gimple_constant (const_tree t)
}
}
/* A wrapper around extract_ops_from_tree_1, for callers which expect
to see only a maximum of two operands. */
/* A wrapper around extract_ops_from_tree with 3 ops, for callers which
expect to see only a maximum of two operands. */
static inline void
extract_ops_from_tree (tree expr, enum tree_code *code, tree *op0,
tree *op1)
{
tree op2;
extract_ops_from_tree_1 (expr, code, op0, op1, &op2);
extract_ops_from_tree (expr, code, op0, op1, &op2);
gcc_assert (op2 == NULL_TREE);
}

@ -387,7 +387,7 @@ gimple_build_assign (tree lhs, tree rhs MEM_STAT_DECL)
enum tree_code subcode;
tree op1, op2, op3;
extract_ops_from_tree_1 (rhs, &subcode, &op1, &op2, &op3);
extract_ops_from_tree (rhs, &subcode, &op1, &op2, &op3);
return gimple_build_assign (lhs, subcode, op1, op2, op3 PASS_MEM_STAT);
}
@ -1578,7 +1578,7 @@ gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *gsi, tree expr)
enum tree_code subcode;
tree op1, op2, op3;
extract_ops_from_tree_1 (expr, &subcode, &op1, &op2, &op3);
extract_ops_from_tree (expr, &subcode, &op1, &op2, &op3);
gimple_assign_set_rhs_with_ops (gsi, subcode, op1, op2, op3);
}

@ -1,3 +1,8 @@
2016-03-11 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/70177
* gcc.dg/pr70177.c: New test.
2016-03-11 Alan Lawrence <alan.lawrence@arm.com>
* gfortran.dg/unconstrained_commons.f: Widen regexp to match j_<N>.

@ -0,0 +1,15 @@
/* PR tree-optimization/70177 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
int b[128];
void
foo (int i, int j)
{
int c, f, g, h;
for (g = 0; g < 64; g++)
for (h = g, f = 0; f <= i; f++, h++)
for (c = 0; c < j; c++)
b[h] = 0;
}

@ -1477,7 +1477,7 @@ defcodefor_name (tree name, enum tree_code *code, tree *arg1, tree *arg2)
|| GIMPLE_BINARY_RHS
|| GIMPLE_UNARY_RHS
|| GIMPLE_SINGLE_RHS)
extract_ops_from_tree_1 (name, &code1, &arg11, &arg21, &arg31);
extract_ops_from_tree (name, &code1, &arg11, &arg21, &arg31);
*code = code1;
*arg1 = arg11;

@ -2742,9 +2742,9 @@ static widest_int
derive_constant_upper_bound (tree val)
{
enum tree_code code;
tree op0, op1;
tree op0, op1, op2;
extract_ops_from_tree (val, &code, &op0, &op1);
extract_ops_from_tree (val, &code, &op0, &op1, &op2);
return derive_constant_upper_bound_ops (TREE_TYPE (val), op0, code, op1);
}