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 c/12372] New: [3.4 regression] miscompilation of execute/20030307-1.c at -O2 and -Os


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: [3.4 regression] miscompilation of execute/20030307-1.c
                    at -O2 and -Os
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: danglin at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: hppa-unknown-linux-gnu
  GCC host triplet: hppa-unknown-linux-gnu
GCC target triplet: hppa-unknown-linux-gnu

The function vfswrap_lock is miscompiled.  This is the assembler output
generated by 3.4 20030922 at -O2:

vfswrap_lock:
        .PROC
        .CALLINFO FRAME=64,CALLS,SAVE_RP
        .ENTRY
        stw %r2,-20(%r30)
        copy %r25,%r26
        ldo 64(%r30),%r30
        ldw -84(%r30),%r2
        copy %r24,%r25
        ldw -120(%r30),%r23
        ldw -116(%r30),%r24
        bl fcntl_lock,%r0
        ldo -64(%r30),%r30
        nop
        .EXIT
        .PROCEND

The copy of the 5th argument on the stack has been lost. 

This is the code generated by 3.3.1:
vfswrap_lock:
        .PROC
        .CALLINFO FRAME=64,CALLS,SAVE_RP
        .ENTRY
        stw %r2,-20(%r30)
        ldo 64(%r30),%r30
        ldw -84(%r30),%r2
        ldw -128(%r30),%r19
        ldw -124(%r30),%r20
        copy %r24,%r21
        copy %r25,%r26
        ldw -120(%r30),%r23
        ldw -116(%r30),%r24
        copy %r21,%r25
        stw %r19,-120(%r30)
        stw %r20,-116(%r30)
        ldw -132(%r30),%r19
        stw %r19,-124(%r30)
        bl fcntl_lock,%r0
        ldo -64(%r30),%r30
        nop
        .EXIT
        .PROCEND

This code executes correctly.


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