[commit: ghc] ghc-parmake-gsoc: Fix bootstrapping of GHC with earlier versions (1f5338e)
git at git.haskell.org
git at git.haskell.org
Wed Sep 4 21:03:10 CEST 2013
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-parmake-gsoc
Link : http://ghc.haskell.org/trac/ghc/changeset/1f5338e7b71f56c6d2451b9b23608c851bf90c8a/ghc
>---------------------------------------------------------------
commit 1f5338e7b71f56c6d2451b9b23608c851bf90c8a
Author: Patrick Palka <patrick at parcs.ath.cx>
Date: Wed Sep 4 14:49:51 2013 -0400
Fix bootstrapping of GHC with earlier versions
We can no longer use atomic_inc() in the stage1 compiler because its
prototype was recently changed.
Since the stage1 compiler is always single-threaded, only use
atomic_inc() when THREADED_RTS is defined.
>---------------------------------------------------------------
1f5338e7b71f56c6d2451b9b23608c851bf90c8a
compiler/cbits/genSym.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/compiler/cbits/genSym.c b/compiler/cbits/genSym.c
index 4217e63..08d403d 100644
--- a/compiler/cbits/genSym.c
+++ b/compiler/cbits/genSym.c
@@ -4,10 +4,14 @@
static HsInt GenSymCounter = 0;
HsInt genSym(void) {
+#if defined(THREADED_RTS)
if (n_capabilities == 1) {
return GenSymCounter++;
} else {
return atomic_inc((StgWord *)&GenSymCounter, 1);
}
+#else
+ return GenSymCounter++;
+#endif
}
More information about the ghc-commits
mailing list