This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [TESTCASE] Minimized testcase for AltiVec segfault
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Daniel Egger <degger at fhm dot edu>
- Cc: GCC Developer Mailinglist <gcc at gcc dot gnu dot org>
- Date: Wed, 27 Feb 2002 15:52:05 +1100
- Subject: 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
-mabi=altivec.
lastly... i can't reproduce on either darwin or ppc linux.
i'm running:
2.4.8-0.4gsmp
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: aldyh@redhat.com
Professional Gypsy Lost in Australia
Red Hat, Inc.