summaryrefslogtreecommitdiff
path: root/ghc/includes
diff options
context:
space:
mode:
authorsimonmar <unknown>2005-11-18 14:24:47 +0000
committersimonmar <unknown>2005-11-18 14:24:47 +0000
commit90a4a81274bcc12f9d6ca8c7259d2f0247d5b80c (patch)
tree18760564bce0fb8c840c8b0cf47dc2677b22ed8e /ghc/includes
parent9342a543736bc7a015ec5857d20e98001c9e990f (diff)
downloadhaskell-90a4a81274bcc12f9d6ca8c7259d2f0247d5b80c.tar.gz
[project @ 2005-11-18 14:24:47 by simonmar]
Omit the __DISCARD__() call in FB_ if __GNUC__ >= 3. It doesn't appear to be necessary now, and it prevents some gcc optimisations.
Diffstat (limited to 'ghc/includes')
-rw-r--r--ghc/includes/TailCalls.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/ghc/includes/TailCalls.h b/ghc/includes/TailCalls.h
index 750b398a92..f62b10e82a 100644
--- a/ghc/includes/TailCalls.h
+++ b/ghc/includes/TailCalls.h
@@ -251,6 +251,8 @@ but uses $$dyncall if necessary to cope, just in case you aren't.
function and these markers is shredded by the mangler.
-------------------------------------------------------------------------- */
+#ifndef FB_
+#if __GNUC__ < 3
/* The following __DISCARD__() has become necessary with gcc 2.96 on x86.
* It prevents gcc from moving stack manipulation code from the function
* body (aka the Real Code) into the function prologue, ie, from moving it
@@ -260,9 +262,17 @@ but uses $$dyncall if necessary to cope, just in case you aren't.
* it just doesn't choose to do it at the moment.
* -= chak
*/
-
-#ifndef FB_
#define FB_ __asm__ volatile ("--- BEGIN ---"); __DISCARD__ ();
+#else
+/* The __DISCARD__() doesn't appear to be necessary with gcc >= 3.2 at
+ * least, and it does cause some difficulty, preventing gcc from
+ * optimising around the beginning of the function. In particular,
+ * gcc leaves some stack assignments in the prologue when the call is
+ * present. --SDM
+
+ */
+#define FB_ __asm__ volatile ("--- BEGIN ---");
+#endif
#endif
#ifndef FE_