Help wanted on PA, sparcv9! Use STACK_POINTER_OFFSET when aligning parameters
Geoffrey Keating
geoffk@apple.com
Thu Sep 25 03:17:00 GMT 2003
This patch takes STACK_POINTER_OFFSET into account when trying to
honour PARAM_BOUNDARY and/or FUNCTION_ARG_BOUNDARY. It's necessary on
rs6000 Darwin when passing altivec parameters, because they want
128-bit alignment but STACK_POINTER_OFFSET is typically 24.
I've looked at all the ports that define STACK_POINTER_OFFSET to see if
they would be affected. Unfortunately, a faulty mail demon ate the
previous message, so I don't have the list; but the summary is that all
those ports define STACK_POINTER_OFFSET to be a multiple of all
possible values of PARAM_BOUNDARY and FUNCTION_ARG_BOUNDARY, with two
exceptions:
- PA, when TARGET_64BIT, uses current_function_outgoing_args_size in
its definition of STACK_POINTER_OFFSET. I *think* that it will have
the correct value at this point, and will always be aligned properly,
but am not sure; could anyone test this patch on PA and see if it works?
- sparc, when TARGET_ARHC64 and TARGET_STACK_BIAS, which defines
STACK_POINTER_OFFSET to be 16*8 + 2047, but wants word alignment of
parameters. I don't understand what's going on here; STACK_BOUNDARY is
set to be 128 bits, so it's taking a 128-bit-aligned value, adding 2047
to it, and then expecting something stored at that address to be
word-aligned? Maybe a sparc maintainer could explain, and/or test the
patch to see what it does?
Anyway, attached is the patch, it's survived a bootstrap & testrun on
powerpc-darwin and, with some additional rs6000-specific patches, lets
you pass altivec arguments to varargs routines like printf() on Darwin.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-functionargalign-A.patch
Type: application/octet-stream
Size: 3226 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030925/e8011995/attachment.obj>
More information about the Gcc-patches
mailing list