Commit 23c1da7a by Martin Jambor Committed by Martin Jambor

gimple-fold.c (fold_gimple_call): New parameter inplace, do not fold builtins if it is true.

2010-09-22  Martin Jambor  <mjambor@suse.cz>

	* gimple-fold.c (fold_gimple_call): New parameter inplace, do not fold
	builtins if it is true.
	(fold_stmt_1): Call, fold_gimple_call always, pass inplace as a
	parameter.

From-SVN: r164517
parent bbaee688
2010-09-22 Martin Jambor <mjambor@suse.cz> 2010-09-22 Martin Jambor <mjambor@suse.cz>
* gimple-fold.c (fold_gimple_call): New parameter inplace, do not fold
builtins if it is true.
(fold_stmt_1): Call, fold_gimple_call always, pass inplace as a
parameter.
2010-09-22 Martin Jambor <mjambor@suse.cz>
* tree-sra.c (struct access): New field grp_no_warning. * tree-sra.c (struct access): New field grp_no_warning.
(create_access_replacement): Set TREE_NO_WARNING according to (create_access_replacement): Set TREE_NO_WARNING according to
grp_no_warning. grp_no_warning.
......
...@@ -1486,7 +1486,7 @@ gimple_fold_obj_type_ref (tree ref, tree known_type) ...@@ -1486,7 +1486,7 @@ gimple_fold_obj_type_ref (tree ref, tree known_type)
It is assumed that the operands have been previously folded. */ It is assumed that the operands have been previously folded. */
static bool static bool
fold_gimple_call (gimple_stmt_iterator *gsi) fold_gimple_call (gimple_stmt_iterator *gsi, bool inplace)
{ {
gimple stmt = gsi_stmt (*gsi); gimple stmt = gsi_stmt (*gsi);
...@@ -1494,7 +1494,7 @@ fold_gimple_call (gimple_stmt_iterator *gsi) ...@@ -1494,7 +1494,7 @@ fold_gimple_call (gimple_stmt_iterator *gsi)
/* Check for builtins that CCP can handle using information not /* Check for builtins that CCP can handle using information not
available in the generic fold routines. */ available in the generic fold routines. */
if (callee && DECL_BUILT_IN (callee)) if (!inplace && callee && DECL_BUILT_IN (callee))
{ {
tree result = gimple_fold_builtin (stmt); tree result = gimple_fold_builtin (stmt);
...@@ -1511,7 +1511,6 @@ fold_gimple_call (gimple_stmt_iterator *gsi) ...@@ -1511,7 +1511,6 @@ fold_gimple_call (gimple_stmt_iterator *gsi)
there requires that we create a new CALL_EXPR, and that requires there requires that we create a new CALL_EXPR, and that requires
copying EH region info to the new node. Easier to just do it copying EH region info to the new node. Easier to just do it
here where we can just smash the call operand. */ here where we can just smash the call operand. */
/* ??? Is there a good reason not to do this in fold_stmt_inplace? */
callee = gimple_call_fn (stmt); callee = gimple_call_fn (stmt);
if (TREE_CODE (callee) == OBJ_TYPE_REF if (TREE_CODE (callee) == OBJ_TYPE_REF
&& TREE_CODE (OBJ_TYPE_REF_OBJECT (callee)) == ADDR_EXPR) && TREE_CODE (OBJ_TYPE_REF_OBJECT (callee)) == ADDR_EXPR)
...@@ -1578,9 +1577,7 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace) ...@@ -1578,9 +1577,7 @@ fold_stmt_1 (gimple_stmt_iterator *gsi, bool inplace)
changed = true; changed = true;
} }
} }
/* The entire statement may be replaced in this case. */ changed |= fold_gimple_call (gsi, inplace);
if (!inplace)
changed |= fold_gimple_call (gsi);
break; break;
case GIMPLE_ASM: case GIMPLE_ASM:
......
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