This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug target/15106] Vector varargs failure for AltiVec on ppc32 linux
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Hartmut Penner <HPENNER at de dot ibm dot com>
- Cc: Aldy Hernandez <aldyh at redhat dot com>,Janis Johnson <janis187 at us dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 27 Apr 2004 21:57:34 +0930
- Subject: Re: [Bug target/15106] Vector varargs failure for AltiVec on ppc32 linux
- References: <OF9A317FA8.CCD85E04-ONC1256E83.003BB24E-C1256E83.003CA71A@de.ibm.com>
On Tue, Apr 27, 2004 at 01:02:29PM +0200, Hartmut Penner wrote:
> Hello,
> Janis posted a bug with a testcase, where all valid combination of
> -maltivec and -mabi=altivec are used. This testcase discovered some
> shortcomings
> on ppc32 & ppc64 linux regarding AltiVec.
>
> Pls take a look at following proposed fix, it is only a draft, need to
> fully test etc.
>
> It fixes testcase except for the combination -maltivec -mabi=no-altivec on
> ppc64,
> which I consider a invalid combination.
>
> regards, Hartmut
Hi Hartmut,
We're working on the same bug again. :)
> Index: gcc/config/rs6000/rs6000.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
> retrieving revision 1.630
> diff -u -p -r1.630 rs6000.c
> --- gcc/config/rs6000/rs6000.c 24 Apr 2004 06:37:18 -0000 1.630
> +++ gcc/config/rs6000/rs6000.c 27 Apr 2004 11:00:02 -0000
> @@ -4481,7 +4481,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum
> n_words = rs6000_arg_size (mode, type);
>
> /* Long long and SPE vectors are put in odd registers. */
> - if (n_words == 2 && (gregno & 1) == 0)
> + if (n_words >= 2 && (gregno & 1) == 0)
> gregno += 1;
This I disagree with. It changes the calling convention for -m32
-mno-altivec -mabi=no-altivec functions that use vector args, both
varargs and non-varags.
--
Alan Modra
IBM OzLabs - Linux Technology Centre