This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Help wanted on PA, sparcv9! Use STACK_POINTER_OFFSET when aligning parameters
- From: Geoffrey Keating <geoffk at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: rth at redhat dot com, davem at redhat dot com, jakub at redhat dot com, law at redhat dot com, dave dot anglin at nrc dot ca
- Date: Wed, 24 Sep 2003 20:14:41 -0700
- Subject: Help wanted on PA, sparcv9! Use STACK_POINTER_OFFSET when aligning parameters
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.
Attachment:
gcc-functionargalign-A.patch
Description: Binary data