simonpj@microsoft.com [Wed, 11 Feb 2009 09:39:39 +0000 (09:39 +0000)]
Improve documentation for LANGUAGE pragma (esp wrt cpp)
Ian Lynagh [Tue, 10 Feb 2009 21:52:15 +0000 (21:52 +0000)]
Don't use the absolute path to the bindist tarball
On Windows, we end up doing something like
rsync c:/build/ghc-6.10.1-unknown-mingw32.tar.bz2 haskell.org:dist
and it thinks that it is meant to get the file from the host called "c".
Now we just do
rsync ghc-6.10.1-unknown-mingw32.tar.bz2 haskell.org:dist
so rsync understand what we mean.
Ian Lynagh [Tue, 10 Feb 2009 22:55:38 +0000 (22:55 +0000)]
Fix cleaning and installing the libraries
When cleaning or installing, we need to ignore what $stage is, and
just clean/install all the libraries.
Simon Marlow [Mon, 9 Feb 2009 11:25:36 +0000 (11:25 +0000)]
scheduleYield(): check the wakeup queue before yielding
Simon Marlow [Fri, 6 Feb 2009 16:57:43 +0000 (16:57 +0000)]
Improvements to the "can't find module" error message (#2980)
If the module was found in multiple hidden packages, we list them all.
Could not find module `Data.Generics':
it is a member of the hidden package `base-3.0.3.0'
it is a member of the hidden package `syb'
Use -v to see a list of the files searched for.
Simon Marlow [Fri, 6 Feb 2009 14:59:21 +0000 (14:59 +0000)]
build fix: add -I../rts/parallel
Simon Marlow [Fri, 6 Feb 2009 13:08:04 +0000 (13:08 +0000)]
crucial bugfix: add a store/load memory barrier to popWSDeque()
Simon Marlow [Fri, 6 Feb 2009 13:07:45 +0000 (13:07 +0000)]
bugfix: an unsigned comparison should be signed
Simon Marlow [Fri, 6 Feb 2009 13:07:15 +0000 (13:07 +0000)]
tiny cleanup
Simon Marlow [Fri, 6 Feb 2009 13:06:09 +0000 (13:06 +0000)]
add debugging code and comments
Simon Marlow [Fri, 6 Feb 2009 13:03:38 +0000 (13:03 +0000)]
add an assertion
Simon Marlow [Fri, 6 Feb 2009 13:01:30 +0000 (13:01 +0000)]
add a single-threaded version of cas()
Simon Marlow [Fri, 6 Feb 2009 13:01:15 +0000 (13:01 +0000)]
add a store/load memory barrier
Simon Marlow [Thu, 5 Feb 2009 12:46:48 +0000 (12:46 +0000)]
Refactor the spark queue implementation into a generic work-stealing deque
So we can use this abstraction elsewhere in the RTS
Ian Lynagh [Sun, 8 Feb 2009 19:14:31 +0000 (19:14 +0000)]
Handle the case where setitimer(ITIMER_VIRTUAL) is not always available
Patch from sthibaul. Fixes trac #2883.
Ian Lynagh [Sat, 7 Feb 2009 00:58:34 +0000 (00:58 +0000)]
Correct an IsFunction that should be IsData
Ian Lynagh [Fri, 6 Feb 2009 22:31:19 +0000 (22:31 +0000)]
Fix calling maths functions when compiling via C
Ian Lynagh [Fri, 6 Feb 2009 15:31:35 +0000 (15:31 +0000)]
Add a panic to fix the build on amd64/Linux; to be fixed properly later
Ian Lynagh [Fri, 6 Feb 2009 15:12:03 +0000 (15:12 +0000)]
Fix the build on OS X: only understands .space, not .skip
Ian Lynagh [Fri, 6 Feb 2009 14:34:32 +0000 (14:34 +0000)]
Fix building with GHC 6.8
Ian Lynagh [Fri, 6 Feb 2009 14:34:20 +0000 (14:34 +0000)]
Fix the build on amd64/Linux
Ian Lynagh [Fri, 6 Feb 2009 14:02:49 +0000 (14:02 +0000)]
When generating C, don't pretend functions are data
We used to generated things like:
extern StgWordArray (newCAF) __attribute__((aligned (8)));
((void (*)(void *))(W_)&newCAF)((void *)R1.w);
(which is to say, pretend that newCAF is some data, then cast it to a
function and call it).
This goes wrong on at least IA64, where:
A function pointer on the ia64 does not point to the first byte of
code. Intsead, it points to a structure that describes the function.
The first quadword in the structure is the address of the first byte
of code
so we end up dereferencing function pointers one time too many, and
segfaulting.
Ben.Lippmeier@anu.edu.au [Thu, 5 Feb 2009 08:06:24 +0000 (08:06 +0000)]
NCG: Validate fixes
Ben.Lippmeier@anu.edu.au [Wed, 4 Feb 2009 05:51:26 +0000 (05:51 +0000)]
NCG: Split RegAllocInfo into arch specific modules
Ben.Lippmeier@anu.edu.au [Wed, 4 Feb 2009 03:52:50 +0000 (03:52 +0000)]
NCG: Move RegLiveness -> RegAlloc.Liveness
Ben.Lippmeier@anu.edu.au [Wed, 4 Feb 2009 03:41:07 +0000 (03:41 +0000)]
NCG: Rename MachRegs, MachInstrs -> Regs, Instrs to reflect arch specific naming
Ben.Lippmeier@anu.edu.au [Wed, 4 Feb 2009 03:07:29 +0000 (03:07 +0000)]
NCG: Split MachRegs.hs into arch specific modules
Ben.Lippmeier@anu.edu.au [Thu, 5 Feb 2009 03:06:42 +0000 (03:06 +0000)]
NCG: Fix validate
Ben.Lippmeier@anu.edu.au [Wed, 4 Feb 2009 04:38:02 +0000 (04:38 +0000)]
SPARC NCG: Fix some haddock problems.
Ben.Lippmeier@anu.edu.au [Wed, 4 Feb 2009 00:09:05 +0000 (00:09 +0000)]
SPARC NCG: Add Pwr callish mach op
Ben.Lippmeier@anu.edu.au [Tue, 3 Feb 2009 08:13:27 +0000 (08:13 +0000)]
NCG: Split MachInstrs into arch specific modules
Ben.Lippmeier@anu.edu.au [Tue, 3 Feb 2009 07:14:11 +0000 (07:14 +0000)]
NCG: Move the graph allocator into its own dir
Ben.Lippmeier@anu.edu.au [Tue, 3 Feb 2009 06:27:46 +0000 (06:27 +0000)]
SPARC NCG: Update cabal file
Ben.Lippmeier@anu.edu.au [Tue, 3 Feb 2009 06:24:33 +0000 (06:24 +0000)]
SPARC NCG: Give regs o0-o5 back to the allocator
Ben.Lippmeier@anu.edu.au [Tue, 3 Feb 2009 04:05:40 +0000 (04:05 +0000)]
NCG: Split out joinToTargets from linear alloctor into its own module.
* Also fix a nasty bug when creating fixup code that has a cyclic
register movement graph.
Ben.Lippmeier@anu.edu.au [Mon, 2 Feb 2009 05:53:01 +0000 (05:53 +0000)]
NCG: Split linear allocator into separate modules.
Ben.Lippmeier@anu.edu.au [Fri, 23 Jan 2009 05:22:47 +0000 (05:22 +0000)]
SPARC NCG: Keep track of destinations when doing a tabled jump
Ben.Lippmeier@anu.edu.au [Fri, 23 Jan 2009 03:51:52 +0000 (03:51 +0000)]
SPARC NCG: Do general 64 bit addition and conversion
Ben.Lippmeier@anu.edu.au [Fri, 23 Jan 2009 00:50:51 +0000 (00:50 +0000)]
SPARC NCG: Don't need a write barrier for store synchronisation on SPARC under TSO.
Ben.Lippmeier@anu.edu.au [Thu, 22 Jan 2009 22:51:50 +0000 (22:51 +0000)]
SPARC NCG: Use .skip instead of .space in assembler
- In the GNU assembler they mean the same thing
- The Solaris assembler only has .skip
simonpj@microsoft.com [Wed, 4 Feb 2009 15:09:19 +0000 (15:09 +0000)]
Check -XGADTs in (a) type family decls (b) pattern matches
Following Trac #2905, we now require -XGADTs for *pattern matches* on
GADTs, not just on *definitions*.
Also I found that -XGADTs wasn't being checked when declaring type families,
so I fixed that too.
simonpj@microsoft.com [Wed, 4 Feb 2009 15:07:36 +0000 (15:07 +0000)]
Improve error reports for kind checking (Trac #2994)
I followed the suggestion in Trac #2994, which took longer than I
expected. As usual I did a bit of tidying up at the same time,
and improved a few other error reports.
simonpj@microsoft.com [Wed, 4 Feb 2009 15:06:25 +0000 (15:06 +0000)]
Further wibbles to 'deriving' for functor-like things
Simon Marlow [Wed, 4 Feb 2009 10:47:48 +0000 (10:47 +0000)]
leave out rts/ from include-dirs in the inplace rts package
it shouldn't be there, and might hide bugs
simonpj@microsoft.com [Wed, 4 Feb 2009 08:38:00 +0000 (08:38 +0000)]
Fix Trac #2999: change an ASSERT to a WARN
A bug in the constraint simplifier means that an equality can be solved
twice. It's harmless, and will go away with the new constraint simplifier.
Hence warning, to avoid unnecessary outright failure on eg Trac #2999.
simonpj@microsoft.com [Wed, 4 Feb 2009 08:25:34 +0000 (08:25 +0000)]
Improve transferPolyIdInfo for value-arg abstraction
If we float a binding out of a *value* lambda, the fixing-up of IdInfo
is a bit more complicated than before. Since in principle FloatOut
can do this (and thus can do full lambda lifting), it's imporrtant
that transferPolyIdInfo does the Right Thing.
This doensn't matter unless you use FloatOut's abilty to lambda-lift,
which GHC mostly doesn't, yet. But Max used it and tripped over this bug.
simonpj@microsoft.com [Wed, 4 Feb 2009 08:19:19 +0000 (08:19 +0000)]
Two small improvements to LiberateCase
Max Bolingbroke suggested these two small improvements to LiberateCase
(most of the size increase is comments :-)):
a) Do LiberateCase on small functions even if they are mutually recursive
See Note [Small enough]
b) Don't do LiberateCase on functions for which it'd be fruitless,
namely when a free varible is scrutinised *outside* the function
See Note [Avoiding fruitless liberate-case]
There is virtually no effect on nofib, but Max tripped over cases
where it mattered slightly.
simonpj@microsoft.com [Thu, 15 Jan 2009 13:48:18 +0000 (13:48 +0000)]
Robustify lookupFamInstEnv, plus some refactoring
This patch deals with the following remark
Suppose we have
type family T a :: * -> *
type instance T Int = []
and now we encounter the type (T Int Bool). If we call
lookupFamInstEnv on (T Int Bool) we'll fail, because T has arity 1.
Indeed, I *think* it's a precondition of lookupFamInstEnv that the
supplied types exactly match the arity of the type function. But
that precondition is neither stated, nor is there an assertion to
check it.
With this patch, lookupFamInstEnv can take "extra" type arguments in
the over-saturated case, and does the Right Thing.
There was a nearly-identical function lookupFamInstEnvUnify, which
required the precisely analogous change, so I took the opportunity
to combine the two into one function, so that bugs can be fixed in one
place. This was a bit harder than I expected, but I think the result
is ok. The conflict-decision function moves from FamInst to FamInstEnv.
Net lines code decreases, although there are more comments.
simonpj@microsoft.com [Wed, 14 Jan 2009 14:01:17 +0000 (14:01 +0000)]
Robustify lookupFamInstEnv
Suppose we have
type family T a :: * -> *
type instance T Int = []
and now we encounter the type (T Int Bool). That is perfectly
fine, even though T is over-saturated here.
This patch makes lookupFamInstEnv robust to such over-saturation.
Previously one caller (TcTyFuns.tcUnfoldSynFamInst) dealt with
the over-saturation case, but the others did not. It's better
to desl with the issue at the root, in lookupFamInstEnv itself.
simonpj@microsoft.com [Tue, 13 Jan 2009 17:58:06 +0000 (17:58 +0000)]
Improve trace message
Ian Lynagh [Tue, 3 Feb 2009 21:36:13 +0000 (21:36 +0000)]
Build dph with the stage2 compiler
It will use TH, so needs to be built with stage2.
Simon Marlow [Mon, 2 Feb 2009 14:50:13 +0000 (14:50 +0000)]
Optimise writing out the .s file
I noticed while working on the new IO library that GHC was writing out
the .s file in lots of little chunks. It turns out that this is a
result of using multiple printDocs to avoid space leaks in the NCG,
where each printDoc is finishing up with an hFlush.
What's worse, is that this makes poor use of the optimisation inside
printDoc that uses its own buffering to avoid hitting the Handle all
the time.
So I hacked around this by making the buffering optimisation inside
Pretty visible from the outside, for use in the NCG. The changes are
quite small.
Simon Marlow [Fri, 23 Jan 2009 14:20:01 +0000 (14:20 +0000)]
better error message for missing package-qualified modules in ghc -M
Simon Marlow [Fri, 30 Jan 2009 11:08:44 +0000 (11:08 +0000)]
add wiki commentary links
Simon Marlow [Fri, 30 Jan 2009 09:19:19 +0000 (09:19 +0000)]
Force the result of user-defined commands
so that exceptions are reported with "*** Exception" instead of as a panic.
simonpj@microsoft.com [Mon, 2 Feb 2009 16:44:50 +0000 (16:44 +0000)]
Improve error reporting for precedence errors
Adopt the suggestion of Trac #2993, and tidy up the reporting of
precedence parsing errors somewhat.
simonpj@microsoft.com [Mon, 2 Feb 2009 13:48:29 +0000 (13:48 +0000)]
Add the ability to derive instances of Functor, Foldable, Traversable
This patch is a straightforward extension of the 'deriving' mechanism.
The ability to derive classes Functor, Foldable, Traverable is controlled
by a single flag -XDeriveFunctor. (Maybe that's a poor name.)
Still to come: documentation
Thanks to twanvl for developing the patch
simonpj@microsoft.com [Fri, 30 Jan 2009 17:54:03 +0000 (17:54 +0000)]
Comments about injecting implicit bindings
Ian Lynagh [Sun, 1 Feb 2009 20:35:05 +0000 (20:35 +0000)]
Warn in configure if it looks like make 3.80 is about to be used
We get caught by
http://savannah.gnu.org/bugs/index.php?1516
$(eval ...) inside conditionals causes errors
with make 3.80, so warn the user if it looks like they're about to
try to use it.
simonpj@microsoft.com [Fri, 30 Jan 2009 15:27:38 +0000 (15:27 +0000)]
Fix Trac #2985: generating superclasses and recursive dictionaries
The Note [Recursive instances and superclases] explains the subtle
issues to do with generating the bindings for superclasses when
we compile an instance declaration, at least if we want to do the
clever "recursive superclass" idea from the SYB3 paper.
The old implementation of tcSimplifySuperClasses stumbled when
type equalities entered the picture (details in the Note); this
patch fixes the problem using a slightly hacky trick. When we
re-engineer the constraint solver we'll want to keep an eye on
this.
Probably worth merging to the 6.10 branch.
simonpj@microsoft.com [Fri, 30 Jan 2009 15:27:05 +0000 (15:27 +0000)]
White space only
simonpj@microsoft.com [Thu, 29 Jan 2009 13:19:54 +0000 (13:19 +0000)]
Two more wibbles to CorePrep (fixes HTTP package and DPH)
Ensuring that
a) lambdas show up only on the RHSs of binding after CorePrep
b) the arity of a binding exactly matches the maifest lambdas
is surprisingly tricky.
I got it wrong (again) in my recent CorePrep shuffling, which broke
packages HTTP and DPH. This patch fixes both.
Ian Lynagh [Wed, 28 Jan 2009 20:07:49 +0000 (20:07 +0000)]
Remove the doc/ contents from the GMP tarball
They are GFDLed, which causes problems for Debian
Simon Marlow [Tue, 27 Jan 2009 12:16:48 +0000 (12:16 +0000)]
#2973: we should virtualise the CWD inside the GHC API, not in the client
The problem is that we install the client's CWD before calling
runStmt, but runStmt has to load modules before running the code. We
need to install the CWD just before running the code instead, which
means it has to be done inside runStmt (and resume).
Simon Marlow [Tue, 27 Jan 2009 09:53:43 +0000 (09:53 +0000)]
Fix detection of i386 vs. x86_64 for -pc-solaris
From #2951
Samuel Bronson [Tue, 27 Jan 2009 08:48:25 +0000 (08:48 +0000)]
Implement #2191 (traceCcs# -- prints CCS of a value when available -- take 3)
In this version, I untag R1 before using it, and even enter R2 at the
end rather than simply returning it (which didn't work right when R2
was a thunk).
Simon Marlow [Mon, 26 Jan 2009 14:00:30 +0000 (14:00 +0000)]
add comment for ASSERT_LOCK_HELD()
Simon Marlow [Mon, 26 Jan 2009 15:02:09 +0000 (15:02 +0000)]
Fix #2961: we lost some of the generated code for stack args in genCCall
A real bug in the x86_64 native code gen: nice!
This bug would have been caught by -Wall, and I would have gone though
and Walled this file but I know Ben is hacking on this file quite
heavily and I don't want to create undue conflicts. Ben: it would be
nice to enable -Wall here when you have time.
Ian Lynagh [Fri, 23 Jan 2009 18:00:15 +0000 (18:00 +0000)]
Make the libffi patch files portable
Solaris's patch can't apply them if the lines beginning "---" aren't
preceeded by a "diff -ur foo bar" line.
Ben.Lippmeier@anu.edu.au [Thu, 22 Jan 2009 09:21:56 +0000 (09:21 +0000)]
SPARC NCG: Also do misaligned reads (this time for sure!)
Ben.Lippmeier@anu.edu.au [Wed, 21 Jan 2009 23:24:23 +0000 (23:24 +0000)]
SPARC NCG: Also do misaligned reads
Ian Lynagh [Wed, 21 Jan 2009 14:17:06 +0000 (14:17 +0000)]
When converting TH syntax to GHC syntax, need to put sections in parentheses
Fixes trac #2956
Ben.Lippmeier@anu.edu.au [Wed, 21 Jan 2009 05:23:34 +0000 (05:23 +0000)]
SPARC NCG: Add a SPARC version of rts_mkInt64 that handles misaligned closure payloads.
Ben.Lippmeier@anu.edu.au [Wed, 21 Jan 2009 03:47:16 +0000 (03:47 +0000)]
SPARC NCG: Reenable out of line 32 bit float ops
Ben.Lippmeier@anu.edu.au [Wed, 21 Jan 2009 02:55:49 +0000 (02:55 +0000)]
SPARC NCG: Clean up formatting and add comments in genCCall
Ben.Lippmeier@anu.edu.au [Wed, 21 Jan 2009 01:26:24 +0000 (01:26 +0000)]
SPARC NCG: Fix format problem when converting float to int
Ben.Lippmeier@anu.edu.au [Wed, 21 Jan 2009 00:37:29 +0000 (00:37 +0000)]
SPARC NCG: fill branch delay slot after tabled jump (doh!)
Ben.Lippmeier@anu.edu.au [Tue, 20 Jan 2009 21:49:14 +0000 (21:49 +0000)]
SPARC NCG: Add tabled switch
Ben.Lippmeier@anu.edu.au [Tue, 20 Jan 2009 09:06:17 +0000 (09:06 +0000)]
SPARC NCG: Fix 64bit integers returned from ccalls
'Jose Pedro Magalhaes [Mon, 19 Jan 2009 11:23:21 +0000 (11:23 +0000)]
#2875: Correct SYB's representation of Char
'Jose Pedro Magalhaes [Tue, 9 Dec 2008 12:55:51 +0000 (12:55 +0000)]
Fix #2759: add ability to serialize Rational
Ben.Lippmeier@anu.edu.au [Tue, 20 Jan 2009 07:51:00 +0000 (07:51 +0000)]
SPARC NCG: Fix warnings
Ben.Lippmeier@anu.edu.au [Fri, 16 Jan 2009 01:18:53 +0000 (01:18 +0000)]
SPARC NCG: Remove a comment that was confusing haddock
Ben.Lippmeier@anu.edu.au [Tue, 20 Jan 2009 07:40:00 +0000 (07:40 +0000)]
SPARC NCG: ppr 64 bit store sizes
Ben.Lippmeier@anu.edu.au [Tue, 20 Jan 2009 07:15:36 +0000 (07:15 +0000)]
SPARC NCG: Fix generation of 64 bit ops on 32 bit sparc
Ben.Lippmeier@anu.edu.au [Tue, 20 Jan 2009 05:21:13 +0000 (05:21 +0000)]
SPARC NCG: Add support for hardware divide
Ben.Lippmeier@anu.edu.au [Thu, 15 Jan 2009 08:41:05 +0000 (08:41 +0000)]
SPARC NCG: Redo code for integer sign extension
Ben.Lippmeier@anu.edu.au [Thu, 15 Jan 2009 08:00:04 +0000 (08:00 +0000)]
SPARC NCG: Fix signed/unsigned operand format bug
Ben.Lippmeier@anu.edu.au [Thu, 15 Jan 2009 05:57:27 +0000 (05:57 +0000)]
More fixes to the SPARC native code generator
* Fix loading of 64bit floats
* Put SRT and other read only static data in the .text segment
Ben.Lippmeier@anu.edu.au [Wed, 14 Jan 2009 05:44:16 +0000 (05:44 +0000)]
Start fixing the SPARC native code generator
* Use BlockIds in branch instructions instead of Imms.
* Assign FP values returned from C calls to the right regs
* Fix loading of F32s
* Add a SPARC version of the FreeRegs map to the linear allcator.
Ben.Lippmeier@anu.edu.au [Mon, 12 Jan 2009 06:33:10 +0000 (06:33 +0000)]
Fix some holes in the SPARC native code generator.
This makes about half the tests in codeGen/should_run work.
Ben.Lippmeier@anu.edu.au [Mon, 12 Jan 2009 05:34:21 +0000 (05:34 +0000)]
Untag closure pointers before trying to print them.
In RTS tracing code, need to untag the pointer before trying
to load the info table in printClosure()
Ben.Lippmeier@anu.edu.au [Mon, 12 Jan 2009 00:56:25 +0000 (00:56 +0000)]
Add missing documention of -Da DEBUG: apply flag to RTS help.
Ben.Lippmeier@anu.edu.au [Sat, 10 Jan 2009 02:58:02 +0000 (02:58 +0000)]
Better panic message in RegAllocLinear
Ben.Lippmeier@anu.edu.au [Sat, 10 Jan 2009 01:44:18 +0000 (01:44 +0000)]
Make the SPARC NCG compile again - it's still broken though.
Ben.Lippmeier@anu.edu.au [Mon, 5 Jan 2009 07:04:29 +0000 (07:04 +0000)]
Enable the native code generator for SPARC
Ian Lynagh [Sun, 18 Jan 2009 19:33:28 +0000 (19:33 +0000)]
Always use PTHREAD_MUTEX_ERRORCHECK to create mutexes when -DDEBUG
Linux defines PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP
anyway, so there's no need to special-case it.
Ian Lynagh [Sat, 17 Jan 2009 21:59:31 +0000 (21:59 +0000)]
Use error-checking mutexes on all platforms when DEBUG is on
Otherwise ASSERT_LOCK_HELD will cause deadlocks
Ian Lynagh [Sat, 17 Jan 2009 20:09:55 +0000 (20:09 +0000)]
Reinstate: Always check the result of pthread_mutex_lock() and pthread_mutex_unlock().
Sun Jan 4 19:24:43 GMT 2009 Matthias Kilian <kili@outback.escape.de>
Don't check pthread_mutex_*lock() only on Linux and/or only if DEBUG
is defined. The return values of those functions are well defined
and should be supported on all operation systems with pthreads. The
checks are cheap enough to do them even in the default build (without
-DDEBUG).
While here, recycle an unused macro ASSERT_LOCK_NOTHELD, and let
the debugBelch part enabled with -DLOCK_DEBUG work independently
of -DDEBUG.
Ian Lynagh [Sat, 17 Jan 2009 02:39:47 +0000 (02:39 +0000)]
Initialise and deinitialise the file_lock_mutex