This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix va-arg-25.c on non-Altivec PowerPC targets
- From: Geoff Keating <geoffk at geoffk dot org>
- Cc: aldyh at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Thu, 16 Oct 2003 18:16:16 -0700
- Subject: Re: Fix va-arg-25.c on non-Altivec PowerPC targets
- Oto: dje@watson.ibm.com
- References: <200310161802.h9GI2ag28434@makai.watson.ibm.com>
> X-Original-To: geoffk@foam.wonderslug.com
> Cc: gcc-patches@gcc.gnu.org
> Date: Thu, 16 Oct 2003 14:02:36 -0400
> From: David Edelsohn <dje@watson.ibm.com>
> X-OriginalArrivalTime: 16 Oct 2003 18:02:54.0609 (UTC) FILETIME=[B905C810:01C3940F]
>
> 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.
TARGET_ALTIVEC is the wrong macro, it should be an ABI test. I'm
pretty sure this patch will cause va-arg-25 to fail on Darwin (you'll
notice that that testcase intentionally does *not* switch on Altivec).
> 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;
>
--
- Geoffrey Keating <geoffk@geoffk.org>