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]

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


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