diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2018-01-03 07:18:13 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2018-01-03 07:18:13 +0000 |
commit | 7b4df2bf95d2254756f6509ee57a90c398baf81b (patch) | |
tree | c05cbaa50ad24f72ed0785372d754691a8e79a2b /gcc/calls.c | |
parent | a930fe51508f431a97eaeb0f546d4b26b40dbfa1 (diff) | |
download | gcc-7b4df2bf95d2254756f6509ee57a90c398baf81b.zip gcc-7b4df2bf95d2254756f6509ee57a90c398baf81b.tar.gz gcc-7b4df2bf95d2254756f6509ee57a90c398baf81b.tar.bz2 |
poly_int: PUSH_ROUNDING
PUSH_ROUNDING is difficult to convert to a hook since there is still
a lot of conditional code based on it. It isn't clear that a direct
conversion with checks for null hooks is the right thing to do.
Rather than untangle that, this patch converts all implementations
that do something to out-of-line functions that have the same
interface as a hook would have. This should at least help towards
any future hook conversion.
2018-01-03 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* config/cr16/cr16-protos.h (cr16_push_rounding): Declare.
* config/cr16/cr16.h (PUSH_ROUNDING): Move implementation to...
* config/cr16/cr16.c (cr16_push_rounding): ...this new function.
* config/h8300/h8300-protos.h (h8300_push_rounding): Declare.
* config/h8300/h8300.h (PUSH_ROUNDING): Move implementation to...
* config/h8300/h8300.c (h8300_push_rounding): ...this new function.
* config/i386/i386-protos.h (ix86_push_rounding): Declare.
* config/i386/i386.h (PUSH_ROUNDING): Move implementation to...
* config/i386/i386.c (ix86_push_rounding): ...this new function.
* config/m32c/m32c-protos.h (m32c_push_rounding): Take and return
a poly_int64.
* config/m32c/m32c.c (m32c_push_rounding): Likewise.
* config/m68k/m68k-protos.h (m68k_push_rounding): Declare.
* config/m68k/m68k.h (PUSH_ROUNDING): Move implementation to...
* config/m68k/m68k.c (m68k_push_rounding): ...this new function.
* config/pdp11/pdp11-protos.h (pdp11_push_rounding): Declare.
* config/pdp11/pdp11.h (PUSH_ROUNDING): Move implementation to...
* config/pdp11/pdp11.c (pdp11_push_rounding): ...this new function.
* config/stormy16/stormy16-protos.h (xstormy16_push_rounding): Declare.
* config/stormy16/stormy16.h (PUSH_ROUNDING): Move implementation to...
* config/stormy16/stormy16.c (xstormy16_push_rounding): ...this new
function.
* expr.c (emit_move_resolve_push): Treat the input and result
of PUSH_ROUNDING as a poly_int64.
(emit_move_complex_push, emit_single_push_insn_1): Likewise.
(emit_push_insn): Likewise.
* lra-eliminations.c (mark_not_eliminable): Likewise.
* recog.c (push_operand): Likewise.
* reload1.c (elimination_effects): Likewise.
* rtlanal.c (nonzero_bits1): Likewise.
* calls.c (store_one_arg): Likewise. Require the padding to be
known at compile time.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r256155
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index 9b7e118..404cccc 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -5639,7 +5639,6 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, ; else if (arg->mode != BLKmode) { - int size; unsigned int parm_align; /* Argument is a scalar, not entirely passed in registers. @@ -5652,10 +5651,8 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, Note that in C the default argument promotions will prevent such mismatches. */ - if (TYPE_EMPTY_P (TREE_TYPE (pval))) - size = 0; - else - size = GET_MODE_SIZE (arg->mode); + poly_int64 size = (TYPE_EMPTY_P (TREE_TYPE (pval)) + ? 0 : GET_MODE_SIZE (arg->mode)); /* Compute how much space the push instruction will push. On many machines, pushing a byte will advance the stack @@ -5669,9 +5666,10 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags, round up to a multiple of the alignment for arguments. */ if (targetm.calls.function_arg_padding (arg->mode, TREE_TYPE (pval)) != PAD_NONE) - used = (((size + PARM_BOUNDARY / BITS_PER_UNIT - 1) - / (PARM_BOUNDARY / BITS_PER_UNIT)) - * (PARM_BOUNDARY / BITS_PER_UNIT)); + /* At the moment we don't (need to) support ABIs for which the + padding isn't known at compile time. In principle it should + be easy to add though. */ + used = force_align_up (size, PARM_BOUNDARY / BITS_PER_UNIT); /* Compute the alignment of the pushed argument. */ parm_align = arg->locate.boundary; |