This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix va-arg-25.c on non-Altivec PowerPC targets
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>, Geoff Keating <geoffk at geoffk dot org>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 16 Oct 2003 14:02:36 -0400
- Subject: Fix va-arg-25.c on non-Altivec PowerPC targets
The new va-arg-25.c testcase failed on non-Altivec PowerPC targets
because rs6000_va_arg() skipped to an aligned argument for any
Altivec-sized vector mode, even when Altivec was not enabled and GCC was
operating in vector compatibility mode. This patch adds a test for
TARGET_ALTIVC and fixes the testsuite failures.
David
* config/rs6000/rs6000.c (rs6000_va_arg): Only align vector
arguments if TARGET_ALTIVEC.
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.531
diff -c -p -r1.531 rs6000.c
*** rs6000.c 13 Oct 2003 16:28:23 -0000 1.531
--- rs6000.c 16 Oct 2003 17:57:07 -0000
*************** rs6000_va_arg (tree valist, tree type)
*** 4371,4377 ****
else
{
/* Altivec arguments must be aligned to a 128-bit boundary. */
! if (ALTIVEC_VECTOR_MODE (TYPE_MODE (type)))
{
tree vtype = TREE_TYPE (valist);
tree new_valist, modify;
--- 4371,4377 ----
else
{
/* Altivec arguments must be aligned to a 128-bit boundary. */
! if (TARGET_ALTIVEC && ALTIVEC_VECTOR_MODE (TYPE_MODE (type)))
{
tree vtype = TREE_TYPE (valist);
tree new_valist, modify;