public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35122]  New: gcc segfaults when compiling code with pointers to vector float
@ 2008-02-07 11:14 hanappe at csl dot sony dot fr
  2008-02-07 15:28 ` [Bug c/35122] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: hanappe at csl dot sony dot fr @ 2008-02-07 11:14 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-07 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-07 11:14 [Bug c/35122] New: gcc segfaults when compiling code with pointers to vector float hanappe at csl dot sony dot fr
2008-02-07 15:28 ` [Bug c/35122] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).