[project @ 1996-07-25 20:43:49 by partain]
[ghc-hetmet.git] / ghc / includes / COptWraps.lh
index 4334cae..baf217b 100644 (file)
@@ -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 (         \