[Bug target/15106] Vector varargs failure for AltiVec on ppc32 linux

Alan Modra amodra@bigpond.net.au
Tue Apr 27 12:49:00 GMT 2004


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



More information about the Gcc-patches mailing list