Commit b9af73fc by Richard Guenther Committed by Richard Biener

re PR tree-optimization/52361 (gcc.dg/pr48141.c times out with checking enabled)

2012-02-24  Richard Guenther  <rguenther@suse.de>

	PR middle-end/52361
	* gimple.c (walk_gimple_op): Use predicates with less redundant
	tests.
	(is_gimple_reg_type): Move inline ...
	* gimple.h (is_gimple_reg_type): ... here.

From-SVN: r184552
parent 6ae4eccd
2012-02-24 Richard Guenther <rguenther@suse.de> 2012-02-24 Richard Guenther <rguenther@suse.de>
PR middle-end/52361 PR middle-end/52361
* gimple.c (walk_gimple_op): Use predicates with less redundant
tests.
(is_gimple_reg_type): Move inline ...
* gimple.h (is_gimple_reg_type): ... here.
2012-02-24 Richard Guenther <rguenther@suse.de>
PR middle-end/52361
* passes.c (execute_function_todo): When verifying SSA form * passes.c (execute_function_todo): When verifying SSA form
verify gimple form first. verify gimple form first.
* tree-ssa.c (verify_ssa): Do not verify gimple form here. * tree-ssa.c (verify_ssa): Do not verify gimple form here.
......
...@@ -1481,7 +1481,7 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op, ...@@ -1481,7 +1481,7 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
tree lhs = gimple_assign_lhs (stmt); tree lhs = gimple_assign_lhs (stmt);
wi->val_only wi->val_only
= (is_gimple_reg_type (TREE_TYPE (lhs)) && !is_gimple_reg (lhs)) = (is_gimple_reg_type (TREE_TYPE (lhs)) && !is_gimple_reg (lhs))
|| !gimple_assign_single_p (stmt); || gimple_assign_rhs_class (stmt) != GIMPLE_SINGLE_RHS;
} }
for (i = 1; i < gimple_num_ops (stmt); i++) for (i = 1; i < gimple_num_ops (stmt); i++)
...@@ -1497,11 +1497,14 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op, ...@@ -1497,11 +1497,14 @@ walk_gimple_op (gimple stmt, walk_tree_fn callback_op,
if (wi) if (wi)
{ {
/* If the RHS has more than 1 operand, it is not appropriate /* If the RHS has more than 1 operand, it is not appropriate
for the memory. */ for the memory.
wi->val_only = !(is_gimple_mem_rhs (gimple_assign_rhs1 (stmt)) ??? A lhs always requires an lvalue, checking the val_only flag
|| TREE_CODE (gimple_assign_rhs1 (stmt)) does not make any sense, so we should be able to avoid computing
== CONSTRUCTOR) it here. */
|| !gimple_assign_single_p (stmt); tree rhs1 = gimple_assign_rhs1 (stmt);
wi->val_only = !(is_gimple_mem_rhs (rhs1)
|| TREE_CODE (rhs1) == CONSTRUCTOR)
|| gimple_assign_rhs_class (stmt) != GIMPLE_SINGLE_RHS;
wi->is_lhs = true; wi->is_lhs = true;
} }
...@@ -2908,14 +2911,6 @@ is_gimple_id (tree t) ...@@ -2908,14 +2911,6 @@ is_gimple_id (tree t)
|| TREE_CODE (t) == STRING_CST); || TREE_CODE (t) == STRING_CST);
} }
/* Return true if TYPE is a suitable type for a scalar register variable. */
bool
is_gimple_reg_type (tree type)
{
return !AGGREGATE_TYPE_P (type);
}
/* Return true if T is a non-aggregate register variable. */ /* Return true if T is a non-aggregate register variable. */
bool bool
......
...@@ -963,8 +963,6 @@ tree gimple_extract_devirt_binfo_from_cst (tree); ...@@ -963,8 +963,6 @@ tree gimple_extract_devirt_binfo_from_cst (tree);
/* Returns true iff T is a valid GIMPLE statement. */ /* Returns true iff T is a valid GIMPLE statement. */
extern bool is_gimple_stmt (tree); extern bool is_gimple_stmt (tree);
/* Returns true iff TYPE is a valid type for a scalar register variable. */
extern bool is_gimple_reg_type (tree);
/* Returns true iff T is a scalar register variable. */ /* Returns true iff T is a scalar register variable. */
extern bool is_gimple_reg (tree); extern bool is_gimple_reg (tree);
/* Returns true iff T is any sort of variable. */ /* Returns true iff T is any sort of variable. */
...@@ -4838,6 +4836,13 @@ gimple_expr_type (const_gimple stmt) ...@@ -4838,6 +4836,13 @@ gimple_expr_type (const_gimple stmt)
return void_type_node; return void_type_node;
} }
/* Return true if TYPE is a suitable type for a scalar register variable. */
static inline bool
is_gimple_reg_type (tree type)
{
return !AGGREGATE_TYPE_P (type);
}
/* Return a new iterator pointing to GIMPLE_SEQ's first statement. */ /* Return a new iterator pointing to GIMPLE_SEQ's first statement. */
......
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