diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-03 07:18:05 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-03 07:18:05 +0000 |
commit | a930fe51508f431a97eaeb0f546d4b26b40dbfa1 (patch) | |
tree | 6c4f6fe2cb98157e4624550c81d5f1dae2f7ef32 | |
parent | b2e894a84ec130c7e8d849728720b29cae1c6063 (diff) | |
download | gcc-a930fe51508f431a97eaeb0f546d4b26b40dbfa1.zip gcc-a930fe51508f431a97eaeb0f546d4b26b40dbfa1.tar.gz gcc-a930fe51508f431a97eaeb0f546d4b26b40dbfa1.tar.bz2 |
poly_int: emit_single_push_insn_1
This patch makes emit_single_push_insn_1 cope with polynomial mode sizes.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial.
Use plus_constant instead of gen_rtx_PLUS.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256154
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/expr.c | 19 |
2 files changed, 13 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 660d354..d37f05a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -2,6 +2,13 @@ Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> + * expr.c (emit_single_push_insn_1): Treat mode sizes as polynomial. + Use plus_constant instead of gen_rtx_PLUS. + +2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> + Alan Hayward <alan.hayward@arm.com> + David Sherwood <david.sherwood@arm.com> + * auto-inc-dec.c (set_inc_state): Take the mode size as a poly_int64 rather than an int. @@ -4155,9 +4155,6 @@ emit_single_push_insn_1 (machine_mode mode, rtx x, tree type) access to type. */ else if (targetm.calls.function_arg_padding (mode, type) == PAD_DOWNWARD) { - unsigned padding_size = rounded_size - GET_MODE_SIZE (mode); - HOST_WIDE_INT offset; - emit_move_insn (stack_pointer_rtx, expand_binop (Pmode, STACK_GROWS_DOWNWARD ? sub_optab @@ -4166,31 +4163,27 @@ emit_single_push_insn_1 (machine_mode mode, rtx x, tree type) gen_int_mode (rounded_size, Pmode), NULL_RTX, 0, OPTAB_LIB_WIDEN)); - offset = (HOST_WIDE_INT) padding_size; + poly_int64 offset = rounded_size - GET_MODE_SIZE (mode); if (STACK_GROWS_DOWNWARD && STACK_PUSH_CODE == POST_DEC) /* We have already decremented the stack pointer, so get the previous value. */ - offset += (HOST_WIDE_INT) rounded_size; + offset += rounded_size; if (!STACK_GROWS_DOWNWARD && STACK_PUSH_CODE == POST_INC) /* We have already incremented the stack pointer, so get the previous value. */ - offset -= (HOST_WIDE_INT) rounded_size; + offset -= rounded_size; - dest_addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx, - gen_int_mode (offset, Pmode)); + dest_addr = plus_constant (Pmode, stack_pointer_rtx, offset); } else { if (STACK_GROWS_DOWNWARD) /* ??? This seems wrong if STACK_PUSH_CODE == POST_DEC. */ - dest_addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx, - gen_int_mode (-(HOST_WIDE_INT) rounded_size, - Pmode)); + dest_addr = plus_constant (Pmode, stack_pointer_rtx, -rounded_size); else /* ??? This seems wrong if STACK_PUSH_CODE == POST_INC. */ - dest_addr = gen_rtx_PLUS (Pmode, stack_pointer_rtx, - gen_int_mode (rounded_size, Pmode)); + dest_addr = plus_constant (Pmode, stack_pointer_rtx, rounded_size); dest_addr = gen_rtx_PRE_MODIFY (Pmode, stack_pointer_rtx, dest_addr); } |