target/8366: sparc-sun-solaris2.7 C testsuite failure w/-m64 -fpic -O in execute/loop-2d.c

ghazi@caip.rutgers.edu ghazi@caip.rutgers.edu
Sat Oct 26 12:31:00 GMT 2002


>Number:         8366
>Category:       target
>Synopsis:       sparc-sun-solaris2.7 C testsuite failure w/-m64 -fpic -O in execute/loop-2d.c
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 26 09:46:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Kaveh Ghazi
>Release:        gcc version 3.2.1 20021025 (prerelease)
>Organization:
>Environment:
sparc-sun-solaris2.7 or sparcv9-sun-solaris2.7
>Description:
I'm getting an abort with the 3.2.x prerelease on sparc-solaris2.7 running the binary from execute/loop-2d.c when compiled with -m64 -fpic -O.  I also get the failure on sparcv9-solaris2.7 with just -fpic -O.  The abort goes away if I remove any of those flags or change the optimization level.  I've pasted the .s file in case that helps catch it by eye, it's not too long.  This abort also occurs in the 3.2 release as well as the 3.1.1 release so I can't say it's a regression, however on sparcv9 it merely requires -fpic -O so I think it's worth a quick look before the next 3.2.x release if time permits and the fix is safe.

        .file   "loop-2d.c"
        .section        ".text"
        .align 4
.LLGETPC0:
        retl
        add     %o7, %l7, %l7
        .align 4
        .global f
        .type   f,#function
        .proc   04
f:
        !#PROLOGUE# 0
        save    %sp, -192, %sp
        sethi   %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
        call    .LLGETPC0
        add     %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
        sllx    %i0, 2, %i2
        ldx     [%l7+a], %i1
        add     %i2, %i1, %i2
        add     %i0, -1, %i1
        cmp     %i1, -1
        be,pn   %icc, .LL8
        ld      [%l7+a+4], %g4
.LL6:
        add     %i2, -4, %i2
        sll     %i1, 1, %i0
        add     %i0, %i1, %i0
        add     %i0, %g4, %i0
        add     %i1, -1, %i1
        cmp     %i1, -1
        bne,pt  %icc, .LL6
        st      %i0, [%i2]
.LL8:
        nop
        return  %i7+8
        nop
.LLfe1:
        .size   f,.LLfe1-f
        .align 4
        .global main
        .type   main,#function
        .proc   04
main:
        !#PROLOGUE# 0
        save    %sp, -192, %sp
        sethi   %hi(_GLOBAL_OFFSET_TABLE_-4), %l7
        call    .LLGETPC0
        add     %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
        ldx     [%l7+a], %l0
        st      %g0, [%l0+4]
        st      %g0, [%l0]
        call    f, 0
        mov     2, %o0
        ld      [%l0], %o1
        cmp     %o1, %l0
        bne,pt  %icc, .LL11
        add     %o1, 3, %o1
        ld      [%l0+4], %o0
        cmp     %o0, %o1
        be,pn   %icc, .LL10
        nop
.LL11:
        call    abort, 0
         nop
.LL10:
        call    exit, 0
        mov     0, %o0
        nop
.LLfe2:
        .size   main,.LLfe2-main
        .common a,8,4
        .ident  "GCC: (GNU) 3.2.1 20021025 (prerelease)"
>How-To-Repeat:
Compile with:

cc1 -fpreprocessed loop-2d.i -mptr64 -mstack-bias -mno-v8plus -mcpu=v9 -quiet -dumpbase loop-2d.c -m64 -O -version -fpic -o loop-2d.s

 /usr/ccs/bin/as -V -Qy -s -K PIC -xarch=v9 -o loop-2d.o loop-2d.s

collect2 -V -Y P,/usr/lib/sparcv9 -Qy /tmp/kg/321/build/gcc/sparcv9/crt1.o /tmp/kg/321/build/gcc/sparcv9/crti.o /usr/ccs/lib/sparcv9/values-Xa.o /tmp/kg/321/build/gcc/sparcv9/crtbegin.o -L/tmp/kg/321/build/gcc/sparcv9 -L/tmp/kg/321/build/gcc -L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 -L/usr/ccs/lib -L/lib/sparcv9 -L/usr/lib/sparcv9 loop-2d.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc /tmp/kg/321/build/gcc/sparcv9/crtend.o /tmp/kg/321/build/gcc/sparcv9/crtn.o

then run the binary file
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list