This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug target/16010] New: Generated code segfaults with -mpa-risc-2-0 and -O1/-O2


Built a vanilla gcc-3.4.0 on a

HP-UX spe192 B.11.11 U 9000/800 1839940656 unlimited-user license

machine using the following configuration:

Configured with: ../gcc-3.4.0/configure --enable-languages=c
--prefix=/house/mhx/gcc/gcc-3.4.0-spe192 --with-gnu-as
--with-as=/usr/local/pa64/bin/hppa64-hp-hpux11.11-as --with-gnu-ld
--with-ld=/usr/local/pa64/bin/hppa64-hp-hpux11.11-ld --disable-shared
--disable-nls --host=hppa64-hp-hpux11.11
Thread model: single
gcc version 3.4.0

The following C program reliably segfaults when built with optimization
levels -O1 and -O2. It doesn't segfault with -O0 and -O3 and above.

---8<---------------------------------------------------------

void fa(long *a, long *b, long *c)
{
    long quot;
    quot = (long) (*b / 24L);
    *b -= quot * 24L;
    *a += quot;
    quot = (long) (*c / 60L);
    *c -= quot * 60L;
    *b += quot;
}

void fb(int *a, int *b, int *c, int *d, int *e, int *f, long g, long h, long i)
{
    fa(&g,&h,&i);
    fa(&g,&h,&i);
}

int main(void)
{
    int a, b, c, d, e, f;
    fb(&a,&b,&c,&d,&e,&f,1,2,3);
    return 0;
}

---8<---------------------------------------------------------

$ gcc -mpa-risc-2-0 -O0 -o test test.c && ./test
$ gcc -mpa-risc-2-0 -O1 -o test test.c && ./test
Segmentation fault (core dumped)
$ gcc -mpa-risc-2-0 -O2 -o test test.c && ./test
Segmentation fault (core dumped)
$ gcc -mpa-risc-2-0 -O3 -o test test.c && ./test
$ 

This is also reproducible with a gcc-3.3.2 prerelease.

I wasn't able to build the gcc-3.5-20040613 snapshot on this
system (xgcc: Internal error: Segmentation fault (program cc1)).

Marcus

-- 
           Summary: Generated code segfaults with -mpa-risc-2-0 and -O1/-O2
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mhx-perl at gmx dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: hppa64-hp-hpux11.11
  GCC host triplet: hppa64-hp-hpux11.11
GCC target triplet: hppa64-hp-hpux11.11


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


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