This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
target/5352: Combonation of SPARC options -mflat -mno-epilogue results in bad code
- From: leob at mailcom dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 10 Jan 2002 21:29:02 -0000
- Subject: target/5352: Combonation of SPARC options -mflat -mno-epilogue results in bad code
- Reply-to: leob at mailcom dot com
>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: