summaryrefslogtreecommitdiff
path: root/ghc/includes/COptWraps.lh
diff options
context:
space:
mode:
Diffstat (limited to 'ghc/includes/COptWraps.lh')
-rw-r--r--ghc/includes/COptWraps.lh22
1 files changed, 15 insertions, 7 deletions
diff --git a/ghc/includes/COptWraps.lh b/ghc/includes/COptWraps.lh
index 4334caec34..baf217b663 100644
--- a/ghc/includes/COptWraps.lh
+++ b/ghc/includes/COptWraps.lh
@@ -613,11 +613,10 @@ gets whatever it's after.
"\tstd %i2,[%fp-32]\n" \
"\tstd %i4,[%fp-24]");
-/* We leave nothing to chance here; we have seen
- GCC stick "unwanted" code in the branch delay
- slot, causing mischief (WDP 96/05)
+/* Lest GCC attempt to stick something in
+ the delay slot: with compile with
+ -fno-delayed-branch. A weak solution. WDP 96/07
*/
-#ifdef GRAN
#define MAGIC_CALL \
__asm__ volatile ( \
"ld [%%fp-40],%%o5\n" \
@@ -631,7 +630,16 @@ gets whatever it's after.
__asm__ volatile ( \
"std %f0,[%fp-40]\n" \
"\tstd %o0,[%fp-32]");
-#else
+#if 0
+/* We leave nothing to chance here; we have seen
+ GCC stick "unwanted" code in the branch delay
+ slot, causing mischief (WDP 96/05)
+*/
+/* the problem with this one: GCC has no way of
+ knowing there is a "call" in there, so it
+ does not do any calling-convention stuff
+ (e.g., saving used regs). WDP 96/07
+*/
#define MAGIC_CALL \
__asm__ volatile ( \
"ld [%%fp-40],%%o5\n" \
@@ -644,8 +652,8 @@ gets whatever it's after.
"\tnop\n" \
"\tstd %%f0,[%%fp-40]\n"\
"\tstd %%o0,[%%fp-32]" \
- : : : "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%f0", "%g1", "%g2", "%g3", "%g4", "memory");
-#endif
+ : : : "%o0", "%o1", "%o2", "%o3", "%o4", "%o5", "%o7", "%f0", "memory");
+#endif /* 0 */
#define MAGIC_RETURN \
__asm__ volatile ( \