Commit bcf71673 by Richard Guenther Committed by Richard Biener

re PR bootstrap/45519 (Failed to bootstrap)

2010-09-04  Richard Guenther  <rguenther@suse.de>

	PR bootstrap/45519
	* tree-flow.h (force_gimple_operand_1): Declare.
	(force_gimple_operand_gsi_1): Likewise.
	* gimplify.c (force_gimple_operand_1): New worker taking a
	gimple predicate for ...
	(force_gimple_operand): ... which now wraps it.
	(force_gimple_operand_gsi_1, force_gimple_operand_gsi): Likewise.
	* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Revert
	last change.
	* tree-ssa-address.c (gimplify_mem_ref_parts): Use
	force_gimple_operand_gsi_1 with is_gimple_mem_ref_addr.
	(create_mem_ref): Likewise.

From-SVN: r163858
parent 770b37b9
2010-09-04 Richard Guenther <rguenther@suse.de>
PR bootstrap/45519
* tree-flow.h (force_gimple_operand_1): Declare.
(force_gimple_operand_gsi_1): Likewise.
* gimplify.c (force_gimple_operand_1): New worker taking a
gimple predicate for ...
(force_gimple_operand): ... which now wraps it.
(force_gimple_operand_gsi_1, force_gimple_operand_gsi): Likewise.
* tree-ssa-loop-ivopts.c (find_interesting_uses_address): Revert
last change.
* tree-ssa-address.c (gimplify_mem_ref_parts): Use
force_gimple_operand_gsi_1 with is_gimple_mem_ref_addr.
(create_mem_ref): Likewise.
2010-09-04 Uros Bizjak <ubizjak@gmail.com> 2010-09-04 Uros Bizjak <ubizjak@gmail.com>
* config/i386/predicates.md (sse_reg_operand): New predicate. * config/i386/predicates.md (sse_reg_operand): New predicate.
......
...@@ -8008,17 +8008,16 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p) ...@@ -8008,17 +8008,16 @@ gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
} }
/* Expands EXPR to list of gimple statements STMTS. If SIMPLE is true, /* Expands EXPR to list of gimple statements STMTS. GIMPLE_TEST_F specifies
force the result to be either ssa_name or an invariant, otherwise the predicate that will hold for the result. If VAR is not NULL, make the
just force it to be a rhs expression. If VAR is not NULL, make the
base variable of the final destination be VAR if suitable. */ base variable of the final destination be VAR if suitable. */
tree tree
force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var) force_gimple_operand_1 (tree expr, gimple_seq *stmts,
gimple_predicate gimple_test_f, tree var)
{ {
tree t; tree t;
enum gimplify_status ret; enum gimplify_status ret;
gimple_predicate gimple_test_f;
struct gimplify_ctx gctx; struct gimplify_ctx gctx;
*stmts = NULL; *stmts = NULL;
...@@ -8026,8 +8025,6 @@ force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var) ...@@ -8026,8 +8025,6 @@ force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var)
if (is_gimple_val (expr)) if (is_gimple_val (expr))
return expr; return expr;
gimple_test_f = simple ? is_gimple_val : is_gimple_reg_rhs;
push_gimplify_context (&gctx); push_gimplify_context (&gctx);
gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun); gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
gimplify_ctxp->allow_rhs_cond_expr = true; gimplify_ctxp->allow_rhs_cond_expr = true;
...@@ -8056,20 +8053,34 @@ force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var) ...@@ -8056,20 +8053,34 @@ force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var)
return expr; return expr;
} }
/* Invokes force_gimple_operand for EXPR with parameters SIMPLE_P and VAR. If /* Expands EXPR to list of gimple statements STMTS. If SIMPLE is true,
some statements are produced, emits them at GSI. If BEFORE is true. force the result to be either ssa_name or an invariant, otherwise
the statements are appended before GSI, otherwise they are appended after just force it to be a rhs expression. If VAR is not NULL, make the
it. M specifies the way GSI moves after insertion (GSI_SAME_STMT or base variable of the final destination be VAR if suitable. */
GSI_CONTINUE_LINKING are the usual values). */
tree tree
force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr, force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var)
bool simple_p, tree var, bool before, {
return force_gimple_operand_1 (expr, stmts,
simple ? is_gimple_val : is_gimple_reg_rhs,
var);
}
/* Invokes force_gimple_operand_1 for EXPR with parameters GIMPLE_TEST_F
and VAR. If some statements are produced, emits them at GSI.
If BEFORE is true. the statements are appended before GSI, otherwise
they are appended after it. M specifies the way GSI moves after
insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING are the usual values). */
tree
force_gimple_operand_gsi_1 (gimple_stmt_iterator *gsi, tree expr,
gimple_predicate gimple_test_f,
tree var, bool before,
enum gsi_iterator_update m) enum gsi_iterator_update m)
{ {
gimple_seq stmts; gimple_seq stmts;
expr = force_gimple_operand (expr, &stmts, simple_p, var); expr = force_gimple_operand_1 (expr, &stmts, gimple_test_f, var);
if (!gimple_seq_empty_p (stmts)) if (!gimple_seq_empty_p (stmts))
{ {
...@@ -8090,4 +8101,24 @@ force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr, ...@@ -8090,4 +8101,24 @@ force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr,
return expr; return expr;
} }
/* Invokes force_gimple_operand_1 for EXPR with parameter VAR.
If SIMPLE is true, force the result to be either ssa_name or an invariant,
otherwise just force it to be a rhs expression. If some statements are
produced, emits them at GSI. If BEFORE is true, the statements are
appended before GSI, otherwise they are appended after it. M specifies
the way GSI moves after insertion (GSI_SAME_STMT or GSI_CONTINUE_LINKING
are the usual values). */
tree
force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr,
bool simple_p, tree var, bool before,
enum gsi_iterator_update m)
{
return force_gimple_operand_gsi_1 (gsi, expr,
simple_p
? is_gimple_val : is_gimple_reg_rhs,
var, before, m);
}
#include "gt-gimplify.h" #include "gt-gimplify.h"
...@@ -824,7 +824,11 @@ extern bool thread_through_all_blocks (bool); ...@@ -824,7 +824,11 @@ extern bool thread_through_all_blocks (bool);
extern void register_jump_thread (edge, edge); extern void register_jump_thread (edge, edge);
/* In gimplify.c */ /* In gimplify.c */
tree force_gimple_operand_1 (tree, gimple_seq *, gimple_predicate, tree);
tree force_gimple_operand (tree, gimple_seq *, bool, tree); tree force_gimple_operand (tree, gimple_seq *, bool, tree);
tree force_gimple_operand_gsi_1 (gimple_stmt_iterator *, tree,
gimple_predicate, tree,
bool, enum gsi_iterator_update);
tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree, tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
bool, enum gsi_iterator_update); bool, enum gsi_iterator_update);
tree gimple_fold_indirect_ref (tree); tree gimple_fold_indirect_ref (tree);
......
...@@ -664,8 +664,8 @@ static void ...@@ -664,8 +664,8 @@ static void
gimplify_mem_ref_parts (gimple_stmt_iterator *gsi, struct mem_address *parts) gimplify_mem_ref_parts (gimple_stmt_iterator *gsi, struct mem_address *parts)
{ {
if (parts->base) if (parts->base)
parts->base = force_gimple_operand_gsi (gsi, parts->base, parts->base = force_gimple_operand_gsi_1 (gsi, parts->base,
true, NULL_TREE, is_gimple_mem_ref_addr, NULL_TREE,
true, GSI_SAME_STMT); true, GSI_SAME_STMT);
if (parts->index) if (parts->index)
parts->index = force_gimple_operand_gsi (gsi, parts->index, parts->index = force_gimple_operand_gsi (gsi, parts->index,
...@@ -724,11 +724,11 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr, ...@@ -724,11 +724,11 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
if (parts.index) if (parts.index)
{ {
atype = TREE_TYPE (tmp); atype = TREE_TYPE (tmp);
parts.base = force_gimple_operand_gsi (gsi, parts.base = force_gimple_operand_gsi_1 (gsi,
fold_build2 (POINTER_PLUS_EXPR, atype, fold_build2 (POINTER_PLUS_EXPR, atype,
tmp, tmp,
fold_convert (sizetype, parts.base)), fold_convert (sizetype, parts.base)),
true, NULL_TREE, true, GSI_SAME_STMT); is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
} }
else else
{ {
...@@ -751,11 +751,11 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr, ...@@ -751,11 +751,11 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
if (parts.base) if (parts.base)
{ {
atype = TREE_TYPE (parts.base); atype = TREE_TYPE (parts.base);
parts.base = force_gimple_operand_gsi (gsi, parts.base = force_gimple_operand_gsi_1 (gsi,
fold_build2 (POINTER_PLUS_EXPR, atype, fold_build2 (POINTER_PLUS_EXPR, atype,
parts.base, parts.base,
parts.index), parts.index),
true, NULL_TREE, true, GSI_SAME_STMT); is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
} }
else else
parts.base = parts.index; parts.base = parts.index;
...@@ -772,11 +772,11 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr, ...@@ -772,11 +772,11 @@ create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr,
if (parts.base) if (parts.base)
{ {
atype = TREE_TYPE (parts.base); atype = TREE_TYPE (parts.base);
parts.base = force_gimple_operand_gsi (gsi, parts.base = force_gimple_operand_gsi_1 (gsi,
fold_build2 (POINTER_PLUS_EXPR, atype, fold_build2 (POINTER_PLUS_EXPR, atype,
parts.base, parts.base,
fold_convert (sizetype, parts.offset)), fold_convert (sizetype, parts.offset)),
true, NULL_TREE, true, GSI_SAME_STMT); is_gimple_mem_ref_addr, NULL_TREE, true, GSI_SAME_STMT);
} }
else else
parts.base = parts.offset; parts.base = parts.offset;
......
...@@ -1788,14 +1788,9 @@ find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p ...@@ -1788,14 +1788,9 @@ find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p
ref = &TREE_OPERAND (*ref, 0); ref = &TREE_OPERAND (*ref, 0);
if (TREE_CODE (*ref) == MEM_REF) if (TREE_CODE (*ref) == MEM_REF)
{ {
tree tem = TREE_OPERAND (*ref, 0); tree tem = fold_binary (MEM_REF, TREE_TYPE (*ref),
STRIP_NOPS (tem); TREE_OPERAND (*ref, 0),
if (tem != TREE_OPERAND (*ref, 0)) TREE_OPERAND (*ref, 1));
tem = fold_build2 (MEM_REF, TREE_TYPE (*ref),
tem, TREE_OPERAND (*ref, 1));
else
tem = fold_binary (MEM_REF, TREE_TYPE (*ref),
tem, TREE_OPERAND (*ref, 1));
if (tem) if (tem)
*ref = tem; *ref = tem;
} }
......
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