This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
GCC 3.0.2: SPARC -mno-epilogue -mflat produces bad code
- From: Leonid A Broukhis <leob at mailcom dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Dec 2001 16:56:23 -0800
- Subject: GCC 3.0.2: SPARC -mno-epilogue -mflat produces bad code
The bug can be demonstrated with or without optimization:
main() { puts("Hello, world"); }
becomes
main:
!#PROLOGUE# 0
!# vars= 0, regs= 2/0, args= 0, extra= 84
add %sp, -120, %sp
st %i7, [%sp+92]
sub %sp, -120, %i7 !# set up frame pointer
st %o7, [%sp+96]
!#PROLOGUE# 1
sethi %hi(.LLC0), %o0
or %o0, %lo(.LLC0), %o0
call puts, 0
nop
return %i7+8 <------- !!!!! THIS IS BAD, results in SIGSEGV
nop
!#EPILOGUE#
sub %i7, 120, %sp !# sp not trusted here
ld [%sp+92], %i7
ld [%sp+96], %o7
retl
add %sp, 120, %sp
Leo