public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/12372] New: [3.4 regression] miscompilation of execute/20030307-1.c at -O2 and -Os
@ 2003-09-22 23:23 danglin at gcc dot gnu dot org
  2003-09-24  5:00 ` [Bug optimization/12372] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: danglin at gcc dot gnu dot org @ 2003-09-22 23:23 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2004-01-27 13:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-22 23:23 [Bug c/12372] New: [3.4 regression] miscompilation of execute/20030307-1.c at -O2 and -Os danglin at gcc dot gnu dot org
2003-09-24  5:00 ` [Bug optimization/12372] " pinskia at gcc dot gnu dot org
2003-09-24 18:40 ` danglin at gcc dot gnu dot org
2003-10-16 12:31 ` ebotcazou at gcc dot gnu dot org
2004-01-10  7:09 ` pinskia at gcc dot gnu dot org
2004-01-10  7:21 ` ebotcazou at gcc dot gnu dot org
2004-01-10 17:41 ` dave at hiauly1 dot hia dot nrc dot ca
2004-01-10 21:39 ` ebotcazou at gcc dot gnu dot org
2004-01-14  9:01 ` steven at gcc dot gnu dot org
2004-01-14  9:12 ` ebotcazou at gcc dot gnu dot org
2004-01-14 17:23 ` pinskia at gcc dot gnu dot org
2004-01-15 14:58 ` cvs-commit at gcc dot gnu dot org
2004-01-15 15:02 ` danglin at gcc dot gnu dot org
2004-01-27 13:08 ` cvs-commit 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).