GCC version:
$ ppu-gcc -v
Using built-in specs.
Target: ppu
Configured with: ../toolchain/gcc/configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info --with-as=/usr/bin/ppu-as
--with-ld=/usr/bin/ppu-ld --enable-threads --with-system-zlib
--disable-checking --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-languages=c,c++,fortran,ada --disable-nls --enable-clocale=gnu
--enable-version-specific-runtime-libs --with-long-double-128
--program-prefix=ppu- --disable-bootstrap --host=ppu
--build=powerpc64-unknown-linux-gnu --target=ppu
Thread model: posix
gcc version 4.1.1

Platform: ppc64, PS3, Linux 2.6.21-1.3194.fc7

Code: 
#include <altivec.h>
#include <stdio.h>

int main(int argc, char** argv)
{
        vector float v =  { 1, 1, 1, 1 };
        vector float* vp = &v;
        fprintf(stderr, "%f\n",v[0]);       // OK
        fprintf(stderr, "%f\n",vp[0][0]);   // internal compiler error:
Segmentation fault
        return 0;
}

or:

#include <altivec.h>
#include <stdio.h>

int main(int argc, char** argv)
{
        vector float v =  { 1, 1, 1, 1 };
        vector float* vp = &v;
        fprintf(stderr, "%f\n",v[0]);       // OK
        fprintf(stderr, "%f\n",(*vp)[0]);   // internal compiler error:
Segmentation fault
        return 0;
}


Command line: ppu-gcc -g -c -maltivec bug.c -o bug.o 

Command output:
bug.c: In function 'main':
bug.c:9: internal compiler error: Segmentation fault


-- 
           Summary: gcc segfaults when compiling code with pointers to
                    vector float
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hanappe at csl dot sony dot fr


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35122

Reply via email to