Simon Marlow [Thu, 19 Feb 2009 10:32:45 +0000 (10:32 +0000)]
newPinnedByteArray#: align the result to 16-bytes (part of #2917)
Simon Marlow [Thu, 19 Feb 2009 10:31:42 +0000 (10:31 +0000)]
Rewrite of signal-handling (ghc patch; see also base and unix patches)
The API is the same (for now). The new implementation has the
capability to define signal handlers that have access to the siginfo
of the signal (#592), but this functionality is not exposed in this
patch.
#2451 is the ticket for the new API.
The main purpose of bringing this in now is to fix race conditions in
the old signal handling code (#2858). Later we can enable the new
API in the HEAD.
Implementation differences:
- More of the signal-handling is moved into Haskell. We store the
table of signal handlers in an MVar, rather than having a table of
StablePtrs in the RTS.
- In the threaded RTS, the siginfo of the signal is passed down the
pipe to the IO manager thread, which manages the business of
starting up new signal handler threads. In the non-threaded RTS,
the siginfo of caught signals is stored in the RTS, and the
scheduler starts new signal handler threads.
Ian Lynagh [Wed, 18 Feb 2009 23:56:20 +0000 (23:56 +0000)]
Fix an off-by-one; fixes the second bug in trac #3001
Ian Lynagh [Wed, 18 Feb 2009 16:59:13 +0000 (16:59 +0000)]
Install libHSffi_p.a
Ian Lynagh [Wed, 18 Feb 2009 00:50:34 +0000 (00:50 +0000)]
Fix ghc and ghci wrappers on Windows
Ian Lynagh [Tue, 17 Feb 2009 21:50:48 +0000 (21:50 +0000)]
Make versioned ghc and ghci programs on Windows; fixes trac #2827
Ben.Lippmeier@anu.edu.au [Tue, 17 Feb 2009 03:52:00 +0000 (03:52 +0000)]
SPARC NCG: Unsigned comparisons are unsigned
Ben.Lippmeier@anu.edu.au [Tue, 17 Feb 2009 02:33:22 +0000 (02:33 +0000)]
SPARC NCG: Fix word size conversions
Ben.Lippmeier@anu.edu.au [Mon, 16 Feb 2009 02:00:38 +0000 (02:00 +0000)]
SPARC NCG: Split up into chunks, and fix warnings.
Ben.Lippmeier@anu.edu.au [Mon, 16 Feb 2009 00:09:45 +0000 (00:09 +0000)]
SPARC NCG: Reorganise Reg and RegInfo
Ben.Lippmeier@anu.edu.au [Mon, 16 Feb 2009 00:08:47 +0000 (00:08 +0000)]
NCG: Cleanup old file
Ben.Lippmeier@anu.edu.au [Sun, 15 Feb 2009 08:36:01 +0000 (08:36 +0000)]
NCG: validate fixes for ppc-darwin
Ben.Lippmeier@anu.edu.au [Sun, 15 Feb 2009 07:13:34 +0000 (07:13 +0000)]
NCG: validate fixes for ghc-6.6
Ben.Lippmeier@anu.edu.au [Sun, 15 Feb 2009 07:32:34 +0000 (07:32 +0000)]
NCG: validate fixes for i386-darwin
Ben.Lippmeier@anu.edu.au [Sun, 15 Feb 2009 07:23:25 +0000 (07:23 +0000)]
NCG: validate fixes for x86_64-linux
Ben.Lippmeier@anu.edu.au [Sun, 15 Feb 2009 06:37:10 +0000 (06:37 +0000)]
NCG: Haddock validate fix
Ben.Lippmeier@anu.edu.au [Sun, 15 Feb 2009 06:23:21 +0000 (06:23 +0000)]
NCG: Validate fixes for x86-linux
Ben.Lippmeier@anu.edu.au [Sun, 15 Feb 2009 06:19:40 +0000 (06:19 +0000)]
SPARC NCG: Don't release top half of f6 and f8
Ben.Lippmeier@anu.edu.au [Sun, 15 Feb 2009 05:51:58 +0000 (05:51 +0000)]
NCG: Split up the native code generator into arch specific modules
- nativeGen/Instruction defines a type class for a generic
instruction set. Each of the instruction sets we have,
X86, PPC and SPARC are instances of it.
- The register alloctors use this type class when they need
info about a certain register or instruction, such as
regUsage, mkSpillInstr, mkJumpInstr, patchRegs..
- nativeGen/Platform defines some data types enumerating
the architectures and operating systems supported by the
native code generator.
- DynFlags now keeps track of the current build platform, and
the PositionIndependentCode module uses this to decide what
to do instead of relying of #ifdefs.
- It's not totally retargetable yet. Some info info about the
build target is still hardwired, but I've tried to contain
most of it to a single module, TargetRegs.
- Moved the SPILL and RELOAD instructions into LiveInstr.
- Reg and RegClass now have their own modules, and are shared
across all architectures.
Ben.Lippmeier@anu.edu.au [Wed, 11 Feb 2009 05:40:21 +0000 (05:40 +0000)]
SPARC NCG: Make linear allocator use info in SPARC.Regs again
Ben.Lippmeier@anu.edu.au [Wed, 11 Feb 2009 02:53:30 +0000 (02:53 +0000)]
SPARC NCG: Enumerate freeRegs / globalRegMaybe instead of using #ifdefery
Ben.Lippmeier@anu.edu.au [Thu, 5 Feb 2009 08:12:42 +0000 (08:12 +0000)]
NCG: Split PprMach into arch specific modules
- There are still some #ifdefs for choosing between i386, x86_64,
linux, darwin and other OS's.
- Also reformat SPARC.RegInfo to remove some of the visual noise.
Ian Lynagh [Fri, 13 Feb 2009 18:56:35 +0000 (18:56 +0000)]
Put RelaxedPolyRec in the cabal file rather than a pragma
This should fix the build with GHC 6.6
Simon Marlow [Thu, 12 Feb 2009 09:23:40 +0000 (09:23 +0000)]
update Sparc store/load barrier (#3019), and fix comments
Simon Marlow [Wed, 11 Feb 2009 15:28:44 +0000 (15:28 +0000)]
comment wibbles
Ben.Lippmeier@anu.edu.au [Fri, 13 Feb 2009 00:49:10 +0000 (00:49 +0000)]
NCG: Use sync instead of msync for a memory barrier for powerpc
Darwin 9.6.0 + GCC 4.0.1 doesn't understand "msync".
I think "sync" means the same thing.
Ben.Lippmeier@anu.edu.au [Fri, 13 Feb 2009 00:48:19 +0000 (00:48 +0000)]
NCG: Split block reorder thing in linear allocator into separate fn
Ben.Lippmeier@anu.edu.au [Fri, 13 Feb 2009 00:47:25 +0000 (00:47 +0000)]
NCG: Validate fixes for powerpc
Ben.Lippmeier@anu.edu.au [Fri, 13 Feb 2009 00:46:47 +0000 (00:46 +0000)]
NCG: Add missing ops to powerpc isJumpish
Ian Lynagh [Thu, 12 Feb 2009 14:10:23 +0000 (14:10 +0000)]
Only pass --with-hscolour to cabal-bin once
Ian Lynagh [Thu, 12 Feb 2009 14:11:20 +0000 (14:11 +0000)]
Quote some more arguments to cabal-bin
Ian Lynagh [Wed, 11 Feb 2009 17:33:33 +0000 (17:33 +0000)]
Add more targets to the list that we need to include all libraries for
simonpj@microsoft.com [Wed, 11 Feb 2009 17:47:33 +0000 (17:47 +0000)]
Fix Trac #3017: ensure that we quantify over enough type variables when equalities are involved
The function FunDeps.grow was not doing the right thing when type equality
constraints were involved. That wasn't really its fault: its input was
being filtered by fdPredsOfInsts.
To fix this I did a bit of refactoring, so that the (revolting) fdPredsOfInsts
is now less important (maybe we can get rid of it in due course). The 'grow'
function moves from FunDeps to
Inst.growInstsTyVars
TcMTType.growThetaTyVars
TcMType.growTyVars
The main comments are with the first of these, in
Note [Growing the tau-tvs using constraints] in Inst.
Push to the branch if conflict free.
Simon Marlow [Wed, 11 Feb 2009 15:24:29 +0000 (15:24 +0000)]
general tidy up
Simon Marlow [Wed, 11 Feb 2009 15:24:21 +0000 (15:24 +0000)]
one more bugfix: a load/load memory barrier is required in stealWSDeque_()
Ian Lynagh [Wed, 11 Feb 2009 15:34:57 +0000 (15:34 +0000)]
Fix trac #3001: Biographical profiling segfaults
We were zeroing the wrong memory
Ian Lynagh [Wed, 11 Feb 2009 15:03:40 +0000 (15:03 +0000)]
Tweak the mangler; fixes trac #2871
It was getting confused by lines like:
# 9 "C:\Temp\/ghc620_0/ghc620_0.hc" 1
Ian Lynagh [Wed, 11 Feb 2009 14:16:00 +0000 (14:16 +0000)]
On sparc, pass -mcpu=v9 when assembling with object splitting enabled
Fixes trac #2872.
simonpj@microsoft.com [Wed, 11 Feb 2009 09:40:28 +0000 (09:40 +0000)]
Turn another ASSERT into a WARN (temproraily)
Fix Trac #3011 by temporarily making it only a WARN if we assign twice
to the same unification variable.
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