This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [TESTCASE] Minimized testcase for AltiVec segfault

> the attached testcase will segfault on powerpc-linux when compiled with
> -O0.
> egger@sonja:~$ /opt/gcc/bin/gcc -da -maltivec -save-temps -O0 -mregnames

first, you can't possibly do -maltivec and not do -mabi=altivec.
who knows what will happen.

second, it would probably better if you configured with --enable-altivec.
did you do that?  if so, you don't need to pass -maltivec or

lastly... i can't reproduce on either darwin or ppc linux.

i'm running:


if the above suggestions don't fix it, someone else needs to take a look
at it, because i sure can't reproduce it.

> #include <altivec.h>
> #include <malloc.h>
> void
> do_something (signed short *mem)
> {
>   const vector signed short zeros = (vector signed short) 
> {0,0,0,0,0,0,0};
>   vector signed short *vec;
>   vector signed short v1[1];
>   vec = (vector signed short *) mem;
>   v1[0] = vec[0];
>   vec[0] = v1[0];
> }
> int
> main (void)
> {
>   void *mem = memalign (128, 16);
>   if (mem)
>   {
>     do_something (mem);
>     free (mem);
>   }
>   return 0;
> }
Aldy Hernandez                                E-mail:
Professional Gypsy Lost in Australia
Red Hat, Inc.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]