diff options
author | Richard Biener <rguenther@suse.de> | 2015-07-24 08:25:41 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2015-07-24 08:25:41 +0000 |
commit | 37d486ab11c0d4f1e860b6dbc46e2e94bb8f0647 (patch) | |
tree | 762fcfff7fe872d4458ad5bab5afaf8c962e9a5b /gcc/gimple-fold.c | |
parent | 74b7ec8c45c8db5df69e7a9894e6306e1d631a58 (diff) | |
download | gcc-37d486ab11c0d4f1e860b6dbc46e2e94bb8f0647.zip gcc-37d486ab11c0d4f1e860b6dbc46e2e94bb8f0647.tar.gz gcc-37d486ab11c0d4f1e860b6dbc46e2e94bb8f0647.tar.bz2 |
gimple-fold.c (replace_stmt_with_simplification): Special-case valueizing call operands.
2015-07-24 Richard Biener <rguenther@suse.de>
* gimple-fold.c (replace_stmt_with_simplification): Special-case
valueizing call operands.
* gimple-match-head.c (maybe_push_res_to_seq): Take
number of call arguments from ops array.
(do_valueize): New function.
(gimple_simplify): Return true if valueization changed
any operand even if the result didn't simplify further.
From-SVN: r226139
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r-- | gcc/gimple-fold.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 2909c42..64f2791 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -3398,6 +3398,19 @@ replace_stmt_with_simplification (gimple_stmt_iterator *gsi, return true; } } + else if (rcode.is_fn_code () + && gimple_call_builtin_p (stmt, rcode)) + { + unsigned i; + for (i = 0; i < gimple_call_num_args (stmt); ++i) + { + gcc_assert (ops[i] != NULL_TREE); + gimple_call_set_arg (stmt, i, ops[i]); + } + if (i < 3) + gcc_assert (ops[i] == NULL_TREE); + return true; + } else if (!inplace) { if (gimple_has_lhs (stmt)) |