diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-09-21 11:14:01 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-09-21 11:14:01 +0000 |
commit | a708f4b67038ff12800a3874722374a66624e2a0 (patch) | |
tree | edc5c36cb2a56966dddefc63972cfbd2eefa465c /gcc/calls.c | |
parent | 6b1237e30840dac66ae8d16507581c948c76c52c (diff) | |
download | gcc-a708f4b67038ff12800a3874722374a66624e2a0.zip gcc-a708f4b67038ff12800a3874722374a66624e2a0.tar.gz gcc-a708f4b67038ff12800a3874722374a66624e2a0.tar.bz2 |
Make more use of simplify_gen_binary
This patch replaces various places that previously used:
if (GET_CODE (y) == CONST_INT)
... plus_constant (..., x, [-]INTVAL (y)) ...
else
... gen_rtx_PLUS/MINUS (..., x, y) ...
with single calls to simplify_gen_binary. This allows
them to handle polynomial integers as well as constants.
2017-09-21 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* calls.c (compute_argument_addresses): Use simplify_gen_binary
rather than choosing between plus_constant and gen_rtx_<CODE>.
* expr.c (emit_push_insn): Likewise.
(expand_expr_real_2): Likewise.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r253059
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index f55e898..6bd025e 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2197,11 +2197,7 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals if (POINTER_BOUNDS_P (args[i].tree_value)) continue; - if (CONST_INT_P (offset)) - addr = plus_constant (Pmode, arg_reg, INTVAL (offset)); - else - addr = gen_rtx_PLUS (Pmode, arg_reg, offset); - + addr = simplify_gen_binary (PLUS, Pmode, arg_reg, offset); addr = plus_constant (Pmode, addr, arg_offset); if (args[i].partial != 0) @@ -2231,11 +2227,7 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals } set_mem_align (args[i].stack, align); - if (CONST_INT_P (slot_offset)) - addr = plus_constant (Pmode, arg_reg, INTVAL (slot_offset)); - else - addr = gen_rtx_PLUS (Pmode, arg_reg, slot_offset); - + addr = simplify_gen_binary (PLUS, Pmode, arg_reg, slot_offset); addr = plus_constant (Pmode, addr, arg_offset); if (args[i].partial != 0) |