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]

target/5352: Combonation of SPARC options -mflat -mno-epilogue results in bad code



>Number:         5352
>Category:       target
>Synopsis:       Combonation of SPARC options -mflat -mno-epilogue results in bad code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 10 13:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     leob@mailcom.com
>Release:        gcc 3.0.2
>Organization:
>Environment:
SunOS 5.7 Generic_106541-02 sun4u sparc SUNW,Ultra-60
>Description:
Compiling any code with -mflat -mno-epilogue results in bad code:

main() { } 

becomes

main:
        !#PROLOGUE# 0
        !# vars= 0, regs= 1/0, args= 0, extra= 84
        add     %sp, -88, %sp
        st      %i7, [%sp+68]
        sub     %sp, -88, %i7   !# set up frame pointer
        !#PROLOGUE# 1
        mov     0, %o0
        return  %i7+8		<--- jumps to stack
         nop
        !#EPILOGUE#
        sub     %i7, 88, %sp            !# sp not trusted here
        ld      [%sp+68], %i7
        retl
        add     %sp, 88, %sp

or, with -fomit-frame-pointer, simply

main:
        !#PROLOGUE# 0
        !# vars= 0, regs= 0/0, args= 0, extra= 0
        !#PROLOGUE# 1
        mov     0, %o0
        return  %i7+8		<-- returns 2 levels up, or to stack
         nop
        !#EPILOGUE#
>How-To-Repeat:
Compile with -mflat -mno-epilogue.
>Fix:

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


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