diff options
author | Jan Hubicka <jh@suse.cz> | 2006-10-28 00:47:47 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2006-10-27 22:47:47 +0000 |
commit | 2e929cf3b29165076c9ed3d83aed1f4d641cab36 (patch) | |
tree | d5a9c18533ff3873d00dd0addf661c1122cbcce5 /gcc/tree-ssa-ccp.c | |
parent | cfe1b18f45699de86d625e28ccb4725a46eaae4e (diff) | |
download | gcc-2e929cf3b29165076c9ed3d83aed1f4d641cab36.zip gcc-2e929cf3b29165076c9ed3d83aed1f4d641cab36.tar.gz gcc-2e929cf3b29165076c9ed3d83aed1f4d641cab36.tar.bz2 |
builtins.c (fold_builtin): Don't generate NOP_EXPR that is going to be thrown away soon when IGNORE is set.
* builtins.c (fold_builtin): Don't generate NOP_EXPR that is going
to be thrown away soon when IGNORE is set.
* tree-ssa-ccp.c (convert_to_gimple_builtin): Add IGNORE argument
indicating when return value shall not be computed.
* gimplify.c (internal_get_tmp_var): Avoid random tree sharing.
From-SVN: r118091
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 8c31a86..3be926d 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2465,17 +2465,24 @@ fold_stmt_inplace (tree stmt) /* Convert EXPR into a GIMPLE value suitable for substitution on the RHS of an assignment. Insert the necessary statements before - iterator *SI_P. */ + iterator *SI_P. + When IGNORE is set, don't worry about the return value. */ static tree -convert_to_gimple_builtin (block_stmt_iterator *si_p, tree expr) +convert_to_gimple_builtin (block_stmt_iterator *si_p, tree expr, bool ignore) { tree_stmt_iterator ti; tree stmt = bsi_stmt (*si_p); tree tmp, stmts = NULL; push_gimplify_context (); - tmp = get_initialized_tmp_var (expr, &stmts, NULL); + if (ignore) + { + tmp = build_empty_stmt (); + gimplify_and_add (expr, &stmts); + } + else + tmp = get_initialized_tmp_var (expr, &stmts, NULL); pop_gimplify_context (NULL); if (EXPR_HAS_LOCATION (stmt)) @@ -2551,7 +2558,9 @@ execute_fold_all_builtins (void) if (!set_rhs (stmtp, result)) { - result = convert_to_gimple_builtin (&i, result); + result = convert_to_gimple_builtin (&i, result, + TREE_CODE (old_stmt) + != MODIFY_EXPR); if (result) { bool ok = set_rhs (stmtp, result); |