summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gcc
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2012-11-15 21:48:16 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2012-11-15 21:48:16 +0000
commit8a8887e784346160e0aca85672ab88455381014e (patch)
treed85e232cc39cfe05698f406080a98af16844f7eb /gnu/usr.bin/gcc
parent82da634ac260f677dfc23f0b4ea2d93ce6a94376 (diff)
Only allow the "return" insn construct (which simply yields a "jmp r1" line)
if null_prologue(), i.e. if there is no stack frame to undo and no r1 to restore. Make the "epilogue" insn construct no longer depend on "return", but rather on "(use (const_int 0))" as "prologue" and as generally done on other backends. On the other hand, make it unconditionnal, instead of "! null_prologue()". These changes make sure than a leaf procedure call does not end up "returning" (i.e. jmp r1) upon return from the call, without restoring r1 and r30 (whenever applicable) from the existing stack frame. This makes a gcc3-compiled __main() (from libgcc2.c) no longer spin after invoking the constructors, and gives the real payload (i.e. main() and whatever follows from there) a chance to run.
Diffstat (limited to 'gnu/usr.bin/gcc')
-rw-r--r--gnu/usr.bin/gcc/gcc/config/m88k/m88k.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.md b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.md
index a79cce0778c..7b2d6905984 100644
--- a/gnu/usr.bin/gcc/gcc/config/m88k/m88k.md
+++ b/gnu/usr.bin/gcc/gcc/config/m88k/m88k.md
@@ -4001,18 +4001,18 @@
(define_insn "return"
[(return)]
- "reload_completed"
+ "null_prologue()"
"jmp%. %#r1"
[(set_attr "type" "jump")])
(define_expand "prologue"
- [(const_int 0)]
+ [(use (const_int 0))]
""
"m88k_expand_prologue (); DONE;")
(define_expand "epilogue"
- [(return)]
- "! null_prologue ()"
+ [(use (const_int 0))]
+ ""
"m88k_expand_epilogue ();")
(define_insn "blockage"