7 years agoMerge branch 'master' of
Ian Lynagh [Fri, 2 Dec 2011 22:30:58 +0000 (22:30 +0000)] 
Merge branch 'master' of

7 years agoRemove unused install_headers and INSTALL_HEADERS
Ian Lynagh [Fri, 2 Dec 2011 22:25:52 +0000 (22:25 +0000)] 
Remove unused install_headers and INSTALL_HEADERS

7 years agoFix header installation
Ian Lynagh [Fri, 2 Dec 2011 22:24:27 +0000 (22:24 +0000)] 
Fix header installation

7 years agoMAKE_RESTARTS should never be higher than 1
Ian Lynagh [Fri, 2 Dec 2011 21:42:59 +0000 (21:42 +0000)] 
MAKE_RESTARTS should never be higher than 1

7 years agoMove includes/DerivedConstants.h and includes/GHCConstants.h into dist dirs
Ian Lynagh [Fri, 2 Dec 2011 21:35:18 +0000 (21:35 +0000)] 
Move includes/DerivedConstants.h and includes/GHCConstants.h into dist dirs

When they existed, they were getting included in the includes_H_FILES
variable (as it uses wildcard to find all header files). But the
.depends files for the programs that generate the headers depend on
$(includes_H_FILES), so the .depends files looked out-of-date once the
headers had been created. This caused unnecessary make reinvocations.

So now we put them in dist* directories, where they ought to be anyway.

7 years agoUse touchy rather than touch when building on Windows
Ian Lynagh [Fri, 2 Dec 2011 16:55:28 +0000 (16:55 +0000)] 
Use touchy rather than touch when building on Windows

With Windows 7 in a vitrual box VM on OS X, some very odd things happen
with dates and time stamps when SSHing into cygwin. e.g. here the
"Change" time is in the past:

$ date; touch foo; stat foo
Fri Dec  2 16:58:07 GMTST 2011
  File: `foo'
  Size: 0               Blocks: 0          IO Block: 65536  regular
empty file
Device: 540aba0bh/1409989131d   Inode: 562949953592977  Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/     ian)   Gid: (  513/    None)
Access: 2011-12-02 16:58:07.414457900 +0000
Modify: 2011-12-02 16:58:07.414457900 +0000
Change: 2011-12-02 16:58:03.495141800 +0000
 Birth: 2011-12-02 16:57:57.731469900 +0000

And if we copy such a file, then the copy is older (as determined by the
"Modify" time) than the original:

$ date; touch foo; stat foo; cp foo bar; stat bar
Fri Dec  2 16:59:10 GMTST 2011
  File: `foo'
  Size: 0               Blocks: 0          IO Block: 65536  regular
empty file
Device: 540aba0bh/1409989131d   Inode: 1407374883725128  Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/     ian)   Gid: (  513/    None)
Access: 2011-12-02 16:59:10.118457900 +0000
Modify: 2011-12-02 16:59:10.118457900 +0000
Change: 2011-12-02 16:59:06.189477700 +0000
 Birth: 2011-12-02 16:57:57.731469900 +0000
  File: `bar'
  Size: 0               Blocks: 0          IO Block: 65536  regular
empty file
Device: 540aba0bh/1409989131d   Inode: 281474976882512  Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/     ian)   Gid: (  513/    None)
Access: 2011-12-02 16:59:06.394555800 +0000
Modify: 2011-12-02 16:59:06.394555800 +0000
Change: 2011-12-02 16:59:06.395532400 +0000
 Birth: 2011-12-02 16:58:40.921899600 +0000

This means that make thinks that things are out of date when it
shouldn't, so reinvokes itself repeatedly until the MAKE_RESTARTS
infinite-recursion test triggers.

The touchy program, like most other programs, creates files with both
Modify and Change in the past, which is still a little odd, but is
consistent, so doesn't break make.

7 years agoMore changes aimed at improving call stacks.
Simon Marlow [Fri, 2 Dec 2011 13:09:14 +0000 (13:09 +0000)] 
More changes aimed at improving call stacks.

  - Attach a SrcSpan to every CostCentre.  This had the side effect
    that CostCentres that used to be merged because they had the same
    name are now considered distinct; so I had to add a Unique to
    CostCentre to give them distinct object-code symbols.

  - New flag: -fprof-auto-calls.  This flag adds an automatic SCC to
    every call site (application, to be precise).  This is typically
    more useful for call stacks than annotating whole functions.

Various tidy-ups at the same time: removed unused NoCostCentre
constructor, and refactored a bit in Coverage.lhs.

The call stack we get from traceStack now looks like this:

Stack trace:
  Main.CAF (<entire-module>)
  Main.main.xs (callstack002.hs:18:12-24) (callstack002.hs:13:12-16) (callstack002.hs:15:21-34) (callstack002.hs:15:21-23)
  Main.f (callstack002.hs:10:7-43)

7 years agoremove unused coreExprCc
Simon Marlow [Fri, 2 Dec 2011 09:33:14 +0000 (09:33 +0000)] 
remove unused coreExprCc

7 years agoForgot an initMutex(); fixes profthreaded failures on Windows
Simon Marlow [Thu, 1 Dec 2011 11:56:39 +0000 (11:56 +0000)] 
Forgot an initMutex(); fixes profthreaded failures on Windows

7 years agoFix a scheduling bug in the threaded RTS
Simon Marlow [Thu, 1 Dec 2011 10:53:28 +0000 (10:53 +0000)] 
Fix a scheduling bug in the threaded RTS

The parallel GC was using setContextSwitches() to stop all the other
threads, which sets the context_switch flag on every Capability.  That
had the side effect of causing every Capability to also switch
threads, and since GCs can be much more frequent than context
switches, this increased the context switch frequency.  When context
switches are expensive (because the switch is between two bound
threads or a bound and unbound thread), the difference is quite

The fix is to have a separate flag to indicate that a Capability
should stop and return to the scheduler, but not switch threads.  I've
called this the "interrupt" flag.

7 years agoloadArchive: need to allocate executable memory on Win32 (#5371)
Simon Marlow [Wed, 30 Nov 2011 15:34:00 +0000 (15:34 +0000)] 
loadArchive: need to allocate executable memory on Win32 (#5371)

7 years agoFix potential crash on Windows: off-by-one in malloc()
Simon Marlow [Wed, 30 Nov 2011 15:25:57 +0000 (15:25 +0000)] 
Fix potential crash on Windows: off-by-one in malloc()

Spotted by gdb's malloc debugger while I was looking for something else.

7 years agoAdd missing newline in RTS help output.
Edward Z. Yang [Thu, 1 Dec 2011 06:27:12 +0000 (01:27 -0500)] 
Add missing newline in RTS help output.

Signed-off-by: Edward Z. Yang <>
7 years agoFix parsing of OPTIONS*/LANGUAGE pragmas in haddock mode
Ian Lynagh [Wed, 30 Nov 2011 22:49:05 +0000 (22:49 +0000)] 
Fix parsing of OPTIONS*/LANGUAGE pragmas in haddock mode

When getting options from basicTypes/RdrName.lhs, we were seeing
text like "-- |\n-- ...\n" in the buffer, and lexer then recognises
"-- |\n-- ..." as a complete ITdocCommentNext token, with the end of
the buffer not reached.

Next time round, when we get more input into the buffer, it started
"\n-- * 'Var.Var': see", so the lexer gave us an ITdocSection token.

However, getOptions' only knew about ITdocCommentNext, and so it
stopped at that point, and didn't see the pragmas further down the file.
This caused the build to fail due to -fwarn-tabs not being turned off.

But actually, we don't really want the haddock docs at this point, so
now we just unset Opt_Haddock in getOptionsFromFile.

7 years agoFix cmd invocation by libffi cuild system on Windows 7 cygwin
Ian Lynagh [Wed, 30 Nov 2011 17:53:08 +0000 (17:53 +0000)] 
Fix cmd invocation by libffi cuild system on Windows 7 cygwin

7 years agoInclude a stack trace in the panic message, when GHC is compiled profiled.
Simon Marlow [Wed, 30 Nov 2011 11:32:23 +0000 (11:32 +0000)] 
Include a stack trace in the panic message, when GHC is compiled profiled.

I tried this out on the panic we're currently getting for #3103:

ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 7.3.20111128 for x86_64-unknown-linux):
        tcIfaceGlobal (local): not found:
    base:GHC.Word.W#{d 6w}
    [(32R, Type constructor `base:GHC.Word.Word{tc 32R}'),
     (r6O, Identifier `base:GHC.Word.$fNumWord{v r6O}'),
     (r6P, Identifier `base:GHC.Word.$fEqWord{v r6P}'),
     (r6Q, Identifier `base:GHC.Word.$fNumWord1{v r6Q}'),
     (r6R, Identifier `base:GHC.Word.$fNumWord2{v r6R}'),
     (r6S, Data constructor `base:GHC.Word.W#{d r6S}'),
     (r6U, Identifier `base:GHC.Word.W#{v r6U}'),
     (r75, Identifier `base:GHC.Word.$fNumWord_$csignum{v r75}'),
     (r76, Identifier `base:GHC.Word.$fEqWord_$c/={v r76}'),
     (r77, Identifier `base:GHC.Word.$fEqWord_$c=={v r77}')]
{ Main.main
                                  TcIface.tcIfaceDataCon }

7 years agoFurther tweaks to the ccs primops
Simon Marlow [Wed, 30 Nov 2011 10:33:47 +0000 (10:33 +0000)] 
Further tweaks to the ccs primops

 - add getCCSOf# :: a -> State# s -> (# State# s, Addr# #)
   (returns the CCS attached to the supplied object)

 - remove traceCcs# (obsoleted by getCCSOf#)

 - rename getCCCS# to getCurrentCCS#

7 years agoremove obsolete notes (#5660)
Simon Marlow [Wed, 30 Nov 2011 08:52:38 +0000 (08:52 +0000)] 
remove obsolete notes (#5660)

7 years agoTurn a bunch of ints into longs to avoid overflow (#5656)
Simon Marlow [Tue, 29 Nov 2011 16:05:05 +0000 (16:05 +0000)] 
Turn a bunch of ints into longs to avoid overflow (#5656)

7 years agoMerge branch 'master' of
Ian Lynagh [Wed, 30 Nov 2011 02:26:13 +0000 (02:26 +0000)] 
Merge branch 'master' of

7 years agoFix libffi depfile creation on Windows: Use -MD rather than -MMD
Ian Lynagh [Wed, 30 Nov 2011 02:24:33 +0000 (02:24 +0000)] 
Fix libffi depfile creation on Windows: Use -MD rather than -MMD

7 years agoMerge branch 'master' of
Simon Peyton Jones [Wed, 30 Nov 2011 01:01:34 +0000 (01:01 +0000)] 
Merge branch 'master' of

7 years agoMerge branch 'master' of
Simon Peyton Jones [Tue, 29 Nov 2011 19:33:48 +0000 (19:33 +0000)] 
Merge branch 'master' of

7 years agoImprove the checkremove util
Ian Lynagh [Sun, 27 Nov 2011 21:27:34 +0000 (21:27 +0000)] 
Improve the checkremove util

We now put the before and after filenames into a tree structure,
which vastly improves performance when simulating the delete

7 years agoMerge branch 'master' of
Dimitrios Vytiniotis [Tue, 29 Nov 2011 19:20:33 +0000 (19:20 +0000)] 
Merge branch 'master' of

7 years agoInsufficient rewriting during flattening. This fixes #5668.
Dimitrios Vytiniotis [Tue, 29 Nov 2011 19:15:17 +0000 (19:15 +0000)] 
Insufficient rewriting during flattening. This fixes #5668.

7 years agoMerge branch 'master' of
Simon Peyton Jones [Tue, 29 Nov 2011 15:50:12 +0000 (15:50 +0000)] 
Merge branch 'master' of

7 years agoRefactor (again) the treatment of record-selector bindings
Simon Peyton Jones [Tue, 29 Nov 2011 15:49:24 +0000 (15:49 +0000)] 
Refactor (again) the treatment of record-selector bindings

We were generating them from the tcg_tcs field of the TcGblEnv,
but that goes badly wrong when there are top-level Template
Haskell splices, because the tcg_tcs field grows successively.
If we generate record-selector binds for all the TyCons in the
accumulated list, we generate them multiple times for TyCons
earlier in the program.  This what was happening in Trac #5665:
  data T = T { x :: Int }
  $(f 4)  -- Top level splice
  ..more code..
Here the record selector bindings for T were being generated

Better instead to generate the record-selector bindings in
TcTyClsDecls, right where the new TyCons are being declared (as indeed
they were some time ago).  This pushed me into doing some refactoring:
instead of returning the record bindings, tcTyAndClassDecls adds them
to the tcg_binds field of the TcGblEnv.  I think the result is a bit
nicer, and it has the additional merit of working.

7 years agoAdd a new primop: getCCCS# :: State# s -> (# State# s, Addr# #)
Simon Marlow [Tue, 29 Nov 2011 14:05:17 +0000 (14:05 +0000)] 
Add a new primop: getCCCS# :: State# s -> (# State# s, Addr# #)

Returns a pointer to the current cost-centre stack when profiling,
NULL otherwise.

7 years agodoc update: -prof now works with +RTS -N (with caveats)
Simon Marlow [Tue, 29 Nov 2011 13:05:48 +0000 (13:05 +0000)] 
doc update: -prof now works with +RTS -N (with caveats)

7 years agoAnother fix to the stg_enter_checkbh frame
Simon Marlow [Tue, 29 Nov 2011 12:43:45 +0000 (12:43 +0000)] 
Another fix to the stg_enter_checkbh frame

7 years agoMake profiling work with multiple capabilities (+RTS -N)
Simon Marlow [Mon, 28 Nov 2011 16:48:43 +0000 (16:48 +0000)] 
Make profiling work with multiple capabilities (+RTS -N)

This means that both time and heap profiling work for parallel
programs.  Main internal changes:

  - CCCS is no longer a global variable; it is now another
    pseudo-register in the StgRegTable struct.  Thus every
    Capability has its own CCCS.

  - There is a new built-in CCS called "IDLE", which records ticks for
    Capabilities in the idle state.  If you profile a single-threaded
    program with +RTS -N2, you'll see about 50% of time in "IDLE".

  - There is appropriate locking in rts/Profiling.c to protect the
    shared cost-centre-stack data structures.

This patch does enough to get it working, I have cut one big corner:
the cost-centre-stack data structure is still shared amongst all
Capabilities, which means that multiple Capabilities will race when
updating the "allocations" and "entries" fields of a CCS.  Not only
does this give unpredictable results, but it runs very slowly due to
cache line bouncing.

It is strongly recommended that you use -fno-prof-count-entries to
disable the "entries" count when profiling parallel programs. (I shall
add a note to this effect to the docs).

7 years agoWhite space only
Simon Peyton Jones [Tue, 29 Nov 2011 11:00:32 +0000 (11:00 +0000)] 
White space only

7 years agostg_enter_checkbh: fix offsets for profiling
Simon Marlow [Mon, 28 Nov 2011 16:27:26 +0000 (16:27 +0000)] 
stg_enter_checkbh: fix offsets for profiling

7 years agoGet rid of the "safety" field of CmmCall (OldCmm)
Simon Marlow [Mon, 28 Nov 2011 16:32:50 +0000 (16:32 +0000)] 
Get rid of the "safety" field of CmmCall (OldCmm)

This field was doing nothing.  I think it originally appeared in a
very old incarnation of the new code generator.

7 years agoSwitch around the order of guards in exprIsConApp_maybe
Simon Peyton Jones [Tue, 29 Nov 2011 07:39:04 +0000 (07:39 +0000)] 
Switch around the order of guards in exprIsConApp_maybe

This is a vital wibble to:
 f7cf3dcd * Be a bit less gung-ho in exprIsConApp_maybe

7 years agoMerge branch 'master' of
Dimitrios Vytiniotis [Tue, 29 Nov 2011 02:00:26 +0000 (02:00 +0000)] 
Merge branch 'master' of

7 years agoReintroducing isReflCo optimization: invariant
Dimitrios Vytiniotis [Tue, 29 Nov 2011 01:51:38 +0000 (01:51 +0000)] 
Reintroducing isReflCo optimization: invariant
that evVarPred.cc_id must be equal to ctPred
needs no longer be true.

7 years agoMerge branch 'master' of
David Waern [Tue, 29 Nov 2011 01:09:28 +0000 (02:09 +0100)] 
Merge branch 'master' of

7 years agoImplement a capi calling convention; fixes #2979
Ian Lynagh [Sat, 26 Nov 2011 14:54:47 +0000 (14:54 +0000)] 
Implement a capi calling convention; fixes #2979

In GHC, this provides an easy way to call a C function via a C wrapper.
This is important when the function is really defined by CPP.

Requires the new CApiFFI extension.

Not documented yet, as it's still an experimental feature at this stage.

7 years agoMerge branch 'master' of
Dimitrios Vytiniotis [Mon, 28 Nov 2011 13:31:19 +0000 (13:31 +0000)] 
Merge branch 'master' of

7 years agoisReflCo no longer reliable for detection of type identity.
Dimitrios Vytiniotis [Sat, 26 Nov 2011 18:15:47 +0000 (18:15 +0000)] 
isReflCo no longer reliable for detection of type identity.

isReflCo is no longer reliable for detection of no-rewriting/flattening
since we are using cached reflexivity solved goals. Introduced a boolean
flag in the flattener for this purpose, instead.

7 years agoImplemented -dsuppress-var-kinds flag to remove silly kinds when dppr-debug is on.
Dimitrios Vytiniotis [Sat, 26 Nov 2011 18:12:21 +0000 (18:12 +0000)] 
Implemented -dsuppress-var-kinds flag to remove silly kinds when dppr-debug is on.

Adding commentary, and fixing a knot-tie related bug.

Commentary only.

7 years agoSolved goal caching and zonking optimisations.
Dimitrios Vytiniotis [Thu, 24 Nov 2011 18:50:02 +0000 (18:50 +0000)] 
Solved goal caching and zonking optimisations.

1) Stopped rewriting and caching solveds in the inerts because
profiling showed that a lot of time was spent on rewriting
already solved goals.

2) Optimisations in zonkEvBinds for common-case
evidence bindings generated from the constraint solver.

3) Now solved goals cache their evidence terms, so that we can more
aggressively optimize Refl coercions during constraint solving.
This patch also includes a rewrite of rewriteInertEqsFromInertEq
which greatly improves its efficiency.

7 years agoThis patch includes:
Dimitrios Vytiniotis [Tue, 22 Nov 2011 17:16:05 +0000 (17:16 +0000)] 
This patch includes:
0) Typo in panic message.
1) prioritization of equalities over family equalities in the worklists.
2) rewriting of inert substitutions and solveds on-the-spot instead of
   kicking them out in the inerts. This required a monadic map over
   substitutions hence the modifications in UniqFM.
3) Just comments and removing stale commented code.

4) Useful SCC for simplifyInfer.

5) Making CoreStats outputable.

7 years agoAllow the quotes to be omitted in {-# SCC "<varid>" #-}
Simon Marlow [Wed, 23 Nov 2011 11:22:03 +0000 (11:22 +0000)] 
Allow the quotes to be omitted in {-# SCC "<varid>" #-}

7 years agoRemove obslete NOTES file
Simon Peyton Jones [Mon, 28 Nov 2011 05:57:17 +0000 (05:57 +0000)] 
Remove obslete NOTES file

7 years agoRemove out of date Simon-log
Simon Peyton Jones [Mon, 28 Nov 2011 05:55:17 +0000 (05:55 +0000)] 
Remove out of date Simon-log

7 years agoRemove out of date new_tc_notes
Simon Peyton Jones [Mon, 28 Nov 2011 05:50:35 +0000 (05:50 +0000)] 
Remove out of date new_tc_notes

7 years agoDon't indirection-zap a function that has a stable unfolding
Simon Peyton Jones [Sun, 27 Nov 2011 19:44:19 +0000 (19:44 +0000)] 
Don't indirection-zap a function that has a stable unfolding

This was responsible for Trac #5001, and it was a real bug;
an inlining could be lost.

7 years agoComments and white space only
Simon Peyton Jones [Sun, 27 Nov 2011 19:43:00 +0000 (19:43 +0000)] 
Comments and white space only

7 years agoBe a bit less gung-ho in exprIsConApp_maybe
Simon Peyton Jones [Sun, 27 Nov 2011 19:42:19 +0000 (19:42 +0000)] 
Be a bit less gung-ho in exprIsConApp_maybe

In particular, don't second-guess callSiteInline by
effectively inlining function call.  This eliminates
the "Interesting!" debug messages we've been getting.
I concluded they weren't interesting enough to account
for the extra complexity!

7 years agoFix document to follow renaming -XPArr to -XParallelArrays
shelarcy [Sun, 27 Nov 2011 05:49:38 +0000 (14:49 +0900)] 
Fix document to follow renaming -XPArr to -XParallelArrays

7 years agoTest whether ld flags exist before using them
Ian Lynagh [Sun, 27 Nov 2011 13:25:51 +0000 (13:25 +0000)] 
Test whether ld flags exist before using them

Some platforms use linkers that don't support the --hash-size=31 and
--reduce-memory-overheads flags.

7 years agoPass "--hash-size=31 --reduce-memory-overhead" to ld; fixes trac #5240
Ian Lynagh [Sun, 27 Nov 2011 00:20:59 +0000 (00:20 +0000)] 
Pass "--hash-size=31 --reduce-memory-overhead" to ld; fixes trac #5240

These reduce the amount of memory that ld takes when linking.

7 years agoAdd missing cases in TcUnify.uUnfilledVars
Simon Peyton Jones [Sat, 26 Nov 2011 21:47:39 +0000 (21:47 +0000)] 
Add missing cases in TcUnify.uUnfilledVars

These missing cases dealt with unifying a meta type variable with a
skolem when the kinds match -- a pretty common case.  The missing
cases meant that instead of directly solving on the fly (which is easy
in this situation) we were generating an equality constraint viat
`utype_defer`.  This isn't *wrong*, but it's a lot less efficient than
it could be!

All this arose from investigating #5631.  This one change does this
to the compiler allocation

     821,257,552 bytes allocated in the heap
              94 MB total memory in use (0 MB lost due to fragmentation)

  MUT     time    1.54s  (  1.67s elapsed)
  GC      time    1.36s  (  1.60s elapsed)
  Total   time    2.93s  (  3.27s elapsed)

     424,244,124 bytes allocated in the heap
              49 MB total memory in use (0 MB lost due to fragmentation)

  MUT     time    0.64s  (  0.89s elapsed)
  GC      time    0.83s  (  0.77s elapsed)
  Total   time    1.47s  (  1.66s elapsed)

Not bad for a 3-line change!

7 years agoDon't list sortBy as a good consumer; fixes trac #5473
Ian Lynagh [Sat, 26 Nov 2011 21:43:42 +0000 (21:43 +0000)] 
Don't list sortBy as a good consumer; fixes trac #5473

7 years agoRecord ValidateSpeed and ValidateHpc in mk/
Ian Lynagh [Sat, 26 Nov 2011 18:59:36 +0000 (18:59 +0000)] 
Record ValidateSpeed and ValidateHpc in mk/

This makes "make" keep working after a "./validate --fast".

7 years agoSmall refactoring
Ian Lynagh [Sat, 26 Nov 2011 18:00:58 +0000 (18:00 +0000)] 
Small refactoring

7 years agoRemove a tabs kludge
Ian Lynagh [Sat, 26 Nov 2011 17:07:48 +0000 (17:07 +0000)] 
Remove a tabs kludge

7 years agoWhitespace only in codeGen/CgForeignCall.hs
Ian Lynagh [Sat, 26 Nov 2011 13:57:45 +0000 (13:57 +0000)] 
Whitespace only in codeGen/CgForeignCall.hs

7 years agoWhitespace only in codeGen/StgCmmForeign.hs
Ian Lynagh [Sat, 26 Nov 2011 13:56:09 +0000 (13:56 +0000)] 
Whitespace only in codeGen/StgCmmForeign.hs

7 years agoSmall refactoring: Turn a needlessly monadic binding into a let binding
Ian Lynagh [Sat, 26 Nov 2011 03:23:06 +0000 (03:23 +0000)] 
Small refactoring: Turn a needlessly monadic binding into a let binding

7 years agoOnly call deSugar from one place
Ian Lynagh [Sat, 26 Nov 2011 02:16:01 +0000 (02:16 +0000)] 
Only call deSugar from one place

7 years agoMove vectorisation of (->) & [::] into the library
Manuel M T Chakravarty [Sat, 26 Nov 2011 13:23:47 +0000 (00:23 +1100)] 
Move vectorisation of (->) & [::] into the library

- (->), [::], & PArray are now vectorised via pragmas (and related clean up)
- Repeatedly vectorising a variable or type constructor now raises an error

7 years agoMerge branch 'master' of
David Waern [Fri, 25 Nov 2011 23:02:29 +0000 (00:02 +0100)] 
Merge branch 'master' of

7 years agoDocument that sync-all supports gc
Ian Lynagh [Fri, 25 Nov 2011 22:59:43 +0000 (22:59 +0000)] 
Document that sync-all supports gc

7 years agoAdd GC command to sync-all.
Edward Z. Yang [Fri, 25 Nov 2011 21:38:21 +0000 (16:38 -0500)] 
Add GC command to sync-all.

Signed-off-by: Edward Z. Yang <>
7 years agoInitial documentation for -XPolyKinds in the user's guide.
Jose Pedro Magalhaes [Wed, 23 Nov 2011 14:04:46 +0000 (14:04 +0000)] 
Initial documentation for -XPolyKinds in the user's guide.

7 years agoLess kinds in error messages
Jose Pedro Magalhaes [Fri, 25 Nov 2011 14:46:24 +0000 (14:46 +0000)] 
Less kinds in error messages

Also "fixes" tcfail158

7 years agoFix kind checking of tuples
Jose Pedro Magalhaes [Tue, 22 Nov 2011 10:49:33 +0000 (10:49 +0000)] 
Fix kind checking of tuples

Makes tcrun043 work again.

7 years agoWhitespace only
Jose Pedro Magalhaes [Tue, 22 Nov 2011 13:18:07 +0000 (13:18 +0000)] 
Whitespace only

7 years agoTime handling overhaul
Simon Marlow [Fri, 25 Nov 2011 13:11:39 +0000 (13:11 +0000)] 
Time handling overhaul

Terminology cleanup: the type "Ticks" has been renamed "Time", which
is an StgWord64 in units of TIME_RESOLUTION (currently nanoseconds).
The terminology "tick" is now used consistently to mean the interval
between timer signals.

The ticker now always ticks in realtime (actually CLOCK_MONOTONIC if
we have it).  Before it used CPU time in the non-threaded RTS and
realtime in the threaded RTS, but I've discovered that the CPU timer
has terrible resolution (at least on Linux) and isn't much use for
profiling.  So now we always use realtime.  This should also fix

The default tick interval is now 10ms, except when profiling where we
drop it to 1ms.  This gives more accurate profiles without affecting
runtime too much (<1%).

Lots of cleanups - the resolution of Time is now in one place
only (Rts.h) rather than having calculations that depend on the
resolution scattered all over the RTS.  I hope I found them all.

7 years agoFix newtype wrapper for 'PData[s] (Wrap a)' and fix VECTORISE type and instance pragmas
Manuel M T Chakravarty [Fri, 25 Nov 2011 11:57:40 +0000 (22:57 +1100)] 
Fix newtype wrapper for 'PData[s] (Wrap a)' and fix VECTORISE type and instance pragmas

* Correct usage of new type wrappers from MkId
* 'VECTORISE [SCALAR] type T = S' didn't work correctly across module boundaries
* Clean up 'VECTORISE SCALAR instance'

7 years agoKeep unicode characters in Haddock comments and comments in the token stream.
David Waern [Fri, 25 Nov 2011 02:05:32 +0000 (03:05 +0100)] 
Keep unicode characters in Haddock comments and comments in the token stream.

7 years agoFixes for NetBSD
Ian Lynagh [Fri, 25 Nov 2011 01:12:47 +0000 (01:12 +0000)] 
Fixes for NetBSD

Based on a patch from Arnaud Degroote <> in
trac #5480.

7 years agoMerge ../bghc
Daniel Fischer [Thu, 24 Nov 2011 16:42:38 +0000 (17:42 +0100)] 
Merge ../bghc

7 years agoFix a few typos
Daniel Fischer [Thu, 24 Nov 2011 15:56:01 +0000 (16:56 +0100)] 
Fix a few typos

7 years agoUpdate the sdist VCS exclusions
Ian Lynagh [Thu, 24 Nov 2011 14:57:05 +0000 (14:57 +0000)] 
Update the sdist VCS exclusions

In particular, we now ignore .git directories

7 years agoFix sdist creation
Ian Lynagh [Thu, 24 Nov 2011 14:49:41 +0000 (14:49 +0000)] 
Fix sdist creation

7 years agoFix markup (non-validate-breaking)
Simon Marlow [Thu, 24 Nov 2011 14:36:33 +0000 (14:36 +0000)] 
Fix markup (non-validate-breaking)

7 years agoRelax the restriction on using abstract newtypes in FFI declarations.
Simon Marlow [Thu, 24 Nov 2011 14:04:23 +0000 (14:04 +0000)] 
Relax the restriction on using abstract newtypes in FFI declarations.

Given the high impact of this change, we decided to back off and make
abstract newtypes give a warning for one release, before we make it an
error in 7.6.1.

    Warning: newtype `CInt' is used in an FFI declaration,
             but its constructor is not in scope.
             This will become an error in GHC 7.6.1.
    When checking declaration:
      foreign import ccall unsafe "static zlib.h deflate" c_deflate
        :: StreamState -> CInt -> IO CInt

7 years agoFix the filename passed to unlit (see comment for details)
Simon Marlow [Thu, 24 Nov 2011 14:00:00 +0000 (14:00 +0000)] 
Fix the filename passed to unlit (see comment for details)

7 years agocopyFileWithHeader: write the header in UTF-8
Simon Marlow [Thu, 24 Nov 2011 10:59:57 +0000 (10:59 +0000)] 
copyFileWithHeader: write the header in UTF-8

7 years agoWhitespace only in glasgow_exts.xml
Daniel Fischer [Thu, 24 Nov 2011 14:49:02 +0000 (15:49 +0100)] 
Whitespace only in glasgow_exts.xml

7 years agoFix userguide markup
Ian Lynagh [Thu, 24 Nov 2011 14:10:59 +0000 (14:10 +0000)] 
Fix userguide markup

7 years agoReplace a couple of "rm -rf" invocations with $(call removeTrees,...)
Ian Lynagh [Thu, 24 Nov 2011 13:36:23 +0000 (13:36 +0000)] 
Replace a couple of "rm -rf" invocations with $(call removeTrees,...)

7 years agoSupport "phase control" for SPECIALISE pragmas
Simon Peyton Jones [Thu, 24 Nov 2011 12:35:33 +0000 (12:35 +0000)] 
Support "phase control" for SPECIALISE pragmas

This featurelet allows Trac #5237 to be fixed.
The idea is to allow SPECIALISE pragmas to specify
the phases in which the RULE is active, just as you can
do with RULES themselves.
  {-# SPECIALISE [1] foo :: Int -> Int #-}

This feature is so obvious that not having it is really a bug.
There are, needless to say, a few wrinkles.  See
   Note [Activation pragmas for SPECIALISE]
in DsBinds

7 years agoMerge branch 'master' of
Simon Peyton Jones [Thu, 24 Nov 2011 12:32:03 +0000 (12:32 +0000)] 
Merge branch 'master' of


7 years agoFix bug in flushStdHandles()
Simon Marlow [Thu, 24 Nov 2011 10:37:14 +0000 (10:37 +0000)] 
Fix bug in flushStdHandles()

Was causing occasional failure in some threaded2 tests.

7 years agofix warnings (validate was failing on i386)
Simon Marlow [Thu, 24 Nov 2011 09:01:05 +0000 (09:01 +0000)] 
fix warnings (validate was failing on i386)

7 years agoMerge branch 'master' of
Simon Peyton Jones [Thu, 24 Nov 2011 09:07:33 +0000 (09:07 +0000)] 
Merge branch 'master' of

7 years agoRemove unused cRelocatableBuild
Simon Marlow [Fri, 11 Nov 2011 15:24:46 +0000 (15:24 +0000)] 
Remove unused cRelocatableBuild

7 years agoDecode escape sequences properly in line pragmas (see comment for details).
Simon Marlow [Wed, 23 Nov 2011 16:13:59 +0000 (16:13 +0000)] 
Decode escape sequences properly in line pragmas (see comment for details).

7 years agoChecking UsageFile: don't fail if the file doesn't exist, just recompile
Simon Marlow [Wed, 23 Nov 2011 15:25:35 +0000 (15:25 +0000)] 
Checking UsageFile: don't fail if the file doesn't exist, just recompile

If a file we depended on last time is missing, we should recompile.

This also makes us insensitive to mistakes when recording dependent
source files (such as storing a temporary file), but will make more
recompilation happen instead.  With DEBUG on, you get a warning.

7 years agoFix build on Windows
Simon Peyton Jones [Wed, 23 Nov 2011 15:15:27 +0000 (15:15 +0000)] 
Fix build on Windows

7 years agoUse mkAppTys, not foldl AppTy, which was utterly wrong
Simon Peyton Jones [Wed, 23 Nov 2011 15:14:56 +0000 (15:14 +0000)] 
Use mkAppTys, not foldl AppTy, which was utterly wrong

This bug caused Trac #5655

7 years agoKeep the flag lists as IntSets rather than lists
Simon Marlow [Tue, 22 Nov 2011 16:23:48 +0000 (16:23 +0000)] 
Keep the flag lists as IntSets rather than lists

This improves compile times slightly.

7 years agoFix and clean up 'PData' and 'Wrap' usage of the vectoriser
Manuel M T Chakravarty [Wed, 23 Nov 2011 04:08:39 +0000 (15:08 +1100)] 
Fix and clean up 'PData' and 'Wrap' usage of the vectoriser

7 years agoDon't warn about not vectorised type synonyms
Manuel M T Chakravarty [Mon, 21 Nov 2011 13:05:05 +0000 (00:05 +1100)] 
Don't warn about not vectorised type synonyms