6 years agouse GhcRtsHcOpts and GhcRtsCcOpts for the debug way too
Simon Marlow [Tue, 29 Jan 2013 09:34:12 +0000 (09:34 +0000)] 
use GhcRtsHcOpts and GhcRtsCcOpts for the debug way too

6 years agoARM: infer VFPv2 presence from the C compiler
Simon Marlow [Tue, 29 Jan 2013 09:10:20 +0000 (09:10 +0000)] 
ARM: infer VFPv2 presence from the C compiler

6 years agohopefully fix #7620
Simon Marlow [Mon, 28 Jan 2013 10:04:34 +0000 (10:04 +0000)] 
hopefully fix #7620

6 years agoMerge branch 'master' of
Simon Peyton Jones [Tue, 29 Jan 2013 08:57:26 +0000 (08:57 +0000)] 
Merge branch 'master' of

6 years agoImprove consistency checking for associated type-family instances
Simon Peyton Jones [Tue, 29 Jan 2013 08:43:02 +0000 (08:43 +0000)] 
Improve consistency checking for associated type-family instances

The "consistency" in this case is beteween the instance head
and the associated type instance head, which is made trickier
by the presence of kind variables that are not explicitly mentioned
in the class head.

See Note [Checking consistent instantiation] in TcInstDcls

This fixes Trac #7282.

6 years agoStaticFlags code cleanup (fixes #7595)
Jan Stolarek [Wed, 16 Jan 2013 13:21:07 +0000 (14:21 +0100)] 
StaticFlags code cleanup (fixes #7595)

Function responsible for parsing the static flags, that were spread
across two modules (StaticFlags and StaticFlagParser), are now
in one file. This is analogous to dynamic flags parsing, which is
also contained within a single module.

Signed-off-by: David Terei <>
6 years agoFix comments on isValArg
Simon Peyton Jones [Mon, 28 Jan 2013 18:21:04 +0000 (18:21 +0000)] 
Fix comments on isValArg

6 years agoComments only
Simon Peyton Jones [Mon, 28 Jan 2013 18:12:01 +0000 (18:12 +0000)] 
Comments only

6 years agoMinor pretty printing changes only
Simon Peyton Jones [Mon, 28 Jan 2013 18:11:25 +0000 (18:11 +0000)] 
Minor pretty printing changes only

6 years agoMerge branch 'master' of
Simon Peyton Jones [Mon, 28 Jan 2013 13:51:55 +0000 (13:51 +0000)] 
Merge branch 'master' of

6 years agoPure refactoring
Simon Peyton Jones [Mon, 28 Jan 2013 13:51:19 +0000 (13:51 +0000)] 
Pure refactoring

* Move tidyType and friends from TcType to TypeRep
  (It was always wrong to have it in TcType.)

* Move mkCoAxBranch and friends from FamInst to Coercion

* Move pprCoAxBranch and friends from FamInstEnv to Coercion

No change in functionality, though there might be a little
wibble in error message output, because I combined two different
functions both called pprCoAxBranch!

6 years agoMore refactoring of FamInst/FamInstEnv; finally fixes Trac #7524
Simon Peyton Jones [Mon, 28 Jan 2013 08:18:28 +0000 (08:18 +0000)] 
More refactoring of FamInst/FamInstEnv; finally fixes Trac #7524

Quite a bit of tidying up here; the fix to #7524 is actually
only a small part.

* Be fully clear that the cab_tvs in a CoAxBranch are not
  fresh.  See Note [CoAxBranch type variables] in CoAxiom.

* Use CoAxBranch to replace the ATDfeault type in Class.
  CoAxBranch is perfect here.  This change allowed me to
  delete quite a bit of boilerplate code, including the
  corresponding IfaceSynType.

* Tidy up the construction of CoAxBranches, and when FamIntBranch is
  freshened.  The latter onw happens only in FamInst.newFamInst.

* Tidy the tyvars of a CoAxBranch when we build them, done in
  FamInst.mkCoAxBranch.  See Note [Tidy axioms when we build them]
  in that module.  This is what fixes #7524.

Much niceer now.

6 years agoFix documentation bug: TSOs are *not* unconditionally kept on the mutable list.
Edward Z. Yang [Mon, 28 Jan 2013 02:25:34 +0000 (18:25 -0800)] 
Fix documentation bug: TSOs are *not* unconditionally kept on the mutable list.

The bug where TSOs were unconditionally kept on the mutable list was #1589
which was fixed in 04cddd339c000df6d02c90ce59dbffa58d2fe166.
Curiously enough, the commit that changed this comment
0417404f5d1230c9d291ea9f73e2831121c8ec99 occurred *after* this
change was made; I can only assume Simon Marlow accidentally forgot
that he had fixed this bug. :-)

Signed-off-by: Edward Z. Yang <>
6 years agouse -e rather than -d when checking for the existence of a subrepo
Patrick Palka [Sun, 13 Jan 2013 17:02:10 +0000 (12:02 -0500)] 
use -e rather than -d when checking for the existence of a subrepo

The .git file in a submodule's root directory is not necessarily a
directory, as is the case for the 'time' submodule.

This fixes #7577, where some './sync-all' operations don't detect
that the 'time' submodule is present in the repository.

6 years agoAdd a "Done." line to compare
Ian Lynagh [Sun, 27 Jan 2013 16:28:36 +0000 (16:28 +0000)] 
Add a "Done." line to compare

Makes it clearer whether it succeeded when redirecting output

6 years agoAdd a kludge to the compare tool for unicode filenames
Ian Lynagh [Sun, 27 Jan 2013 16:26:35 +0000 (16:26 +0000)] 
Add a kludge to the compare tool for unicode filenames

It thought that something impossible was happening when they
were involved.

6 years agoUse Test.Regex.PCRE instead of .Posix in compare
Ian Lynagh [Sun, 27 Jan 2013 16:18:06 +0000 (16:18 +0000)] 
Use Test.Regex.PCRE instead of .Posix in compare

This program:

    main :: IO ()
    main = do re "[^ ]" "\207"
              re "[ ]" "\207"
              re " " "\207"

    re :: String -> String -> IO ()
    re r str = let r' = makeRegex r :: Regex
                   res = matchM r' str :: Maybe (String, String, String, [String])
               in print res



for me with Posix, but

    Just ("","\207","",[])

with PCRE. This was causing compare to fail with

    Tar line doesn't parse: "drwxrwxr-x simonmar/GHC       0 2012-12-08 21:35 ghc-\206\188\206\177\207\\302\\203/"

on the GHC source tarball.

6 years agoAdd support to compare for comparing whole directories
Ian Lynagh [Sun, 27 Jan 2013 15:59:34 +0000 (15:59 +0000)] 
Add support to compare for comparing whole directories

6 years agofix ARM hard float "detection"
Simon Marlow [Fri, 25 Jan 2013 20:50:43 +0000 (20:50 +0000)] 
fix ARM hard float "detection"

6 years agoImprove LLVM options for ARMv6
Simon Marlow [Fri, 25 Jan 2013 20:50:00 +0000 (20:50 +0000)] 
Improve LLVM options for ARMv6

- -float-abi=hard also works for arm v6
- pass -mattr=+vfp2 if we have VFP2

Submitted by: Karel Gardas <>

6 years agoMerge branch 'master' of
Simon Peyton Jones [Fri, 25 Jan 2013 12:50:03 +0000 (12:50 +0000)] 
Merge branch 'master' of

6 years agoUse kind 'Symbol' consistently, rather than kind 'String'
Simon Peyton Jones [Fri, 25 Jan 2013 12:49:19 +0000 (12:49 +0000)] 
Use kind 'Symbol' consistently, rather than kind 'String'

6 years agoRefactor and improve the promotion inference
Simon Peyton Jones [Fri, 25 Jan 2013 12:48:06 +0000 (12:48 +0000)] 
Refactor and improve the promotion inference

It should be the case that either an entire mutually recursive
group of data type declarations can be promoted, or none of them.
It's really odd to promote some data constructors of a type but
not others. Eg
  data T a = T1 a | T2 Int
Here T1 is sort-of-promotable but T2 isn't (becuase Int isn't

This patch makes it all-or-nothing. At the same time I've made
the TyCon point to its promoted cousin (via the tcPromoted field
of an AlgTyCon), as well as vice versa (via the ty_con field of

The inference for the group is done in TcTyDecls, the same place
that infers which data types are recursive, another global question.

6 years agoAllow -fllvm to be used when compiling unregisterised (#7622)
Simon Marlow [Fri, 25 Jan 2013 09:54:49 +0000 (09:54 +0000)] 
Allow -fllvm to be used when compiling unregisterised (#7622)

6 years agoFix various issues with a Stage1Only=NO cross-compile
Simon Marlow [Fri, 25 Jan 2013 08:48:03 +0000 (08:48 +0000)] 
Fix various issues with a Stage1Only=NO cross-compile

6 years agoAdded support to cross-compile to android
Nathan [Wed, 23 Jan 2013 17:07:19 +0000 (18:07 +0100)] 
Added support to cross-compile to android

Signed-off-by: David Terei <>
6 years agodo not use -rpath-link linker option on Solaris.
David Terei [Thu, 24 Jan 2013 21:45:56 +0000 (13:45 -0800)] 
do not use -rpath-link linker option on Solaris.

Patch from Karel Gardas <>.

6 years agoMerge branch 'master' of
Simon Peyton Jones [Thu, 24 Jan 2013 13:19:31 +0000 (13:19 +0000)] 
Merge branch 'master' of

6 years agoghc: mkGmpDerivedConstants binary gone away
Sergei Trofimovich [Wed, 23 Jan 2013 23:04:23 +0000 (02:04 +0300)] 
ghc: mkGmpDerivedConstants binary gone away

6 years agofix rts/Linker compilation issues on AMD64/Solaris platform
Simon Marlow [Wed, 23 Jan 2013 10:23:08 +0000 (10:23 +0000)] 
fix rts/Linker compilation issues on AMD64/Solaris platform

Submitted by: Karel Gardas <>

6 years agoSolaris: do not use timer_create
Simon Marlow [Wed, 23 Jan 2013 10:22:47 +0000 (10:22 +0000)] 
Solaris: do not use timer_create

Submitted by: Karel Gardas <>

6 years agoTidy up: move info-table related stuff to CmmInfo
Simon Marlow [Wed, 23 Jan 2013 10:19:25 +0000 (10:19 +0000)] 
Tidy up: move info-table related stuff to CmmInfo

Prep for #709

6 years agofix validate-breaking warning
Simon Marlow [Wed, 23 Jan 2013 09:27:40 +0000 (09:27 +0000)] 
fix validate-breaking warning

6 years agoAdd support for nto-qnx (BlackBerry 10)
Simon Marlow [Wed, 23 Jan 2013 09:21:39 +0000 (09:21 +0000)] 
Add support for nto-qnx (BlackBerry 10)

Submitted by: Stephen Paul Weber <>

6 years agoFix our handling of literals and types in LLVM (#7575).
David Terei [Wed, 23 Jan 2013 08:38:43 +0000 (00:38 -0800)] 
Fix our handling of literals and types in LLVM (#7575).

This bug was introduced in the recent fix for #7571, that extended some
existing infastructure in the LLVM backend that handled the conflict
between LLVM's return type from comparison operations (i1) and what GHC
expects (word). By extending it to handle literals though, we forced all
literals to be i1 or word, breaking other code.

This patch resolves this breakage and handles #7571 still, cleaning up
the code for both a little. The overall approach is not ideal but
changing that is left for the future.

6 years agoFix llvm backend when 32bit build on 64bit OSX. (#7617)
David Terei [Wed, 23 Jan 2013 07:05:46 +0000 (23:05 -0800)] 
Fix llvm backend when 32bit build on 64bit OSX. (#7617)

6 years agoAllow CaseElim if the case binder is the next thing to be eval'd
Simon Peyton Jones [Tue, 22 Jan 2013 22:46:33 +0000 (22:46 +0000)] 
Allow CaseElim if the case binder is the next thing to be eval'd

This makes CaseElim happen a bit more often.
See Note [Case binder next] in Simplify.
This came up when investigating Trac #7542.

6 years agoAllow eta-reduction of eval'd functions if of arity 1
Simon Peyton Jones [Tue, 22 Jan 2013 22:43:22 +0000 (22:43 +0000)] 
Allow eta-reduction of eval'd functions if of arity 1

See Note [Eta reduction of an eval'd function] in CoreUtils.
This doesn't fix Trac #7542, but that was the ticket that
pointed out this infelicity.

6 years agoComments only
Simon Peyton Jones [Tue, 22 Jan 2013 22:39:39 +0000 (22:39 +0000)] 
Comments only

6 years agoEnsure the LLVM codegen correctly handles literals in a branch. #7571
Austin Seipp [Sun, 13 Jan 2013 04:34:05 +0000 (04:34 +0000)] 
Ensure the LLVM codegen correctly handles literals in a branch. #7571

We need to be sure that when generating code for literals, we properly narrow
the type of the literal to i1. See Note [Literals and branch conditions] in the
LlvmCodeGen.CodeGen module.

This occurs rarely as the optimizer will remove conditional branches with
literals, however we can get this situation occurring with hand written Cmm

This fixes Trac #7571.

Signed-off-by: David Terei <>
6 years agoUse pprTypeForUser when printing kinds in ghci
Simon Peyton Jones [Tue, 22 Jan 2013 17:34:30 +0000 (17:34 +0000)] 
Use pprTypeForUser when printing kinds in ghci

6 years agoMerge branch 'master' of
Simon Peyton Jones [Tue, 22 Jan 2013 17:01:49 +0000 (17:01 +0000)] 
Merge branch 'master' of

6 years agoWhen printing types in the interactive UI, take account of free variables
Simon Peyton Jones [Tue, 22 Jan 2013 17:01:30 +0000 (17:01 +0000)] 
When printing types in the interactive UI, take account of free variables

Often the types we print are full-generalised, but in fact *kinds* are
not, so we need to use tidyOpenType.

Fixes Trac #7587

6 years agoExploit the invariant for AxInstCo to simplify coercionKind
Simon Peyton Jones [Tue, 22 Jan 2013 16:57:35 +0000 (16:57 +0000)] 
Exploit the invariant for AxInstCo to simplify coercionKind

6 years agoComments only
Simon Peyton Jones [Tue, 22 Jan 2013 16:57:07 +0000 (16:57 +0000)] 
Comments only

6 years agoUpdate mailing lists in the users guide
Ian Lynagh [Tue, 22 Jan 2013 16:56:41 +0000 (16:56 +0000)] 
Update mailing lists in the users guide

6 years agoComments only (about trimming the type environment)
Simon Peyton Jones [Mon, 21 Jan 2013 10:27:28 +0000 (10:27 +0000)] 
Comments only (about trimming the type environment)

6 years agoUp supported LLVM version to 3.3.
David Terei [Sat, 19 Jan 2013 01:22:09 +0000 (17:22 -0800)] 
Up supported LLVM version to 3.3.

Actual support is in progress but we will accept bugs against these
version. LLVM 3.2 seems in good shape at this point anyway.

6 years agoMerge branch 'master' of
Ian Lynagh [Fri, 18 Jan 2013 18:17:32 +0000 (18:17 +0000)] 
Merge branch 'master' of

6 years agoRemove unused HscStats.lhs; fixes #7605
Ian Lynagh [Fri, 18 Jan 2013 17:16:05 +0000 (17:16 +0000)] 
Remove unused HscStats.lhs; fixes #7605

6 years agoDocument overlapping instances more clearly
Simon Peyton Jones [Fri, 18 Jan 2013 17:07:04 +0000 (17:07 +0000)] 
Document overlapping instances more clearly

6 years agoMerge branch 'master' of
Simon Peyton Jones [Fri, 18 Jan 2013 14:31:59 +0000 (14:31 +0000)] 
Merge branch 'master' of

6 years agoAdd missing case in eqHsBang; makes rnfail055 pass again
Simon Peyton Jones [Fri, 18 Jan 2013 14:31:39 +0000 (14:31 +0000)] 
Add missing case in eqHsBang; makes rnfail055 pass again

6 years agoRestore the primitive and vector submodules
Simon Marlow [Fri, 18 Jan 2013 09:46:30 +0000 (09:46 +0000)] 
Restore the primitive and vector submodules

I accidentally deleted them in 109a1e53287f50103e8a5b592275940b6e3dbb53

6 years agoExpose genericRaise; fixes signals004(dyn) no OS X 32
Ian Lynagh [Thu, 17 Jan 2013 21:54:06 +0000 (21:54 +0000)] 
Expose genericRaise; fixes signals004(dyn) no OS X 32

6 years agoMerge branch 'master' of
Ian Lynagh [Thu, 17 Jan 2013 23:22:50 +0000 (23:22 +0000)] 
Merge branch 'master' of

6 years agoIf -msse is specified, pass it to the LLVM backend
Johan Tibell [Thu, 17 Jan 2013 21:18:44 +0000 (13:18 -0800)] 
If -msse is specified, pass it to the LLVM backend

6 years agoClean up -msse flag handling
Johan Tibell [Thu, 17 Jan 2013 19:11:49 +0000 (11:11 -0800)] 
Clean up -msse flag handling

We know have a single flag that takes a version number, instead of one
flag per SSE version.

6 years agoHopefully fix breakage on OS X w/ LLVM
Simon Marlow [Thu, 17 Jan 2013 16:42:38 +0000 (16:42 +0000)] 
Hopefully fix breakage on OS X w/ LLVM

Reordering of includes in GC.c broke on OS X because gctKey is
declared in Task.h and is needed in the storage manager.  This is
really the wrong place for it anyway, so I've moved the gctKey pieces
to where they should be.

6 years agoUse pthread_kill on OS X too
Ian Lynagh [Thu, 17 Jan 2013 19:23:17 +0000 (19:23 +0000)] 
Use pthread_kill on OS X too

Fixes signals004(threaded1,threaded2) on OS X 32.

6 years agoExpose the prototype for getMonotonicNSec
Ian Lynagh [Thu, 17 Jan 2013 15:33:26 +0000 (15:33 +0000)] 
Expose the prototype for getMonotonicNSec

Fixes T3807 on OS X 32.

6 years agoMerge branch 'master' of
Simon Peyton Jones [Thu, 17 Jan 2013 13:57:37 +0000 (13:57 +0000)] 
Merge branch 'master' of

6 years agoTidy up cross-compiling
Simon Marlow [Thu, 17 Jan 2013 11:52:15 +0000 (11:52 +0000)] 
Tidy up cross-compiling

We have two cases:
 1. building a cross-compiler
 2. compiling GHC to run on a foreign platform

These two are done with almost the same setup: (1) is the stage 1
compiler, and (2) is the stage 2 compiler, when CrossCompiling=YES.

The only difference between (1) and (2) is that you if you set up the
build for (1), then it stops before stage 2 and you can 'make install'
to install stage 1.

Unfortunately, (2) didn't work, and the build system code needed some
tidying up.

Change to the way the build is set up:


To build a cross-compiler:
  ./configure --target=<..>

To compile a foreign GHC:
  ./configure --host=<..> --target=<..>


To build a cross-compiler:
  ./configure --target=<..>
  And set "Stage1Only=YES" in mk/

To compile a foreign GHC:
  ./configure --target=<..>

6 years agoMerge branch 'master' of
Simon Peyton Jones [Thu, 17 Jan 2013 10:55:10 +0000 (10:55 +0000)] 
Merge branch 'master' of

6 years agoA simple improvement to CSE
Simon Peyton Jones [Thu, 17 Jan 2013 10:55:00 +0000 (10:55 +0000)] 
A simple improvement to CSE

See Note [CSE for case expressions].  I don't think this is a big
deal, but it's nice, and it's easy.

6 years agoMajor patch to implement the new Demand Analyser
Simon Peyton Jones [Thu, 17 Jan 2013 10:54:07 +0000 (10:54 +0000)] 
Major patch to implement the new Demand Analyser

This patch is the result of Ilya Sergey's internship at MSR.  It
constitutes a thorough overhaul and simplification of the demand
analyser.  It makes a solid foundation on which we can now build.
Main changes are

* Instead of having one combined type for Demand, a Demand is
   now a pair (JointDmd) of
      - a StrDmd and
      - an AbsDmd.
   This allows strictness and absence to be though about quite
   orthogonally, and greatly reduces brain melt-down.

* Similarly in the DmdResult type, it's a pair of
     - a PureResult (indicating only divergence/non-divergence)
     - a CPRResult (which deals only with the CPR property

* In IdInfo, the
    strictnessInfo field contains a StrictSig, not a Maybe StrictSig
    demandInfo     field contains a Demand, not a Maybe Demand
  We don't need Nothing (to indicate no strictness/demand info)
  any more; topSig/topDmd will do.

* Remove "boxity" analysis entirely.  This was an attempt to
  avoid "reboxing", but it added complexity, is extremely
  ad-hoc, and makes very little difference in practice.

* Remove the "unboxing strategy" computation. This was an an
  attempt to ensure that a worker didn't get zillions of
  arguments by unboxing big tuples.  But in fact removing it
  DRAMATICALLY reduces allocation in an inner loop of the
  I/O library (where the threshold argument-count had been
  set just too low).  It's exceptional to have a zillion arguments
  and I don't think it's worth the complexity, especially since
  it turned out to have a serious performance hit.

* Remove quite a bit of ad-hoc cruft

* Move worthSplittingFun, worthSplittingThunk from WorkWrap to
  Demand. This allows JointDmd to be fully abstract, examined
  only inside Demand.

Everything else really follows from these changes.

All of this is really just refactoring, so we don't expect
big performance changes, but acutally the numbers look quite
good.  Here is a full nofib run with some highlights identified:

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
         expert          -2.6%    -15.5%      0.00      0.00     +0.0%
          fluid          -2.4%     -7.1%      0.01      0.01     +0.0%
             gg          -2.5%    -28.9%      0.02      0.02    -33.3%
      integrate          -2.6%     +3.2%     +2.6%     +2.6%     +0.0%
        mandel2          -2.6%     +4.2%      0.01      0.01     +0.0%
       nucleic2          -2.0%    -16.3%      0.11      0.11     +0.0%
           para          -2.6%    -20.0%    -11.8%    -11.7%     +0.0%
         parser          -2.5%    -17.9%      0.05      0.05     +0.0%
         prolog          -2.6%    -13.0%      0.00      0.00     +0.0%
         puzzle          -2.6%     +2.2%     +0.8%     +0.8%     +0.0%
        sorting          -2.6%    -35.9%      0.00      0.00     +0.0%
       treejoin          -2.6%    -52.2%     -9.8%     -9.9%     +0.0%
            Min          -2.7%    -52.2%    -11.8%    -11.7%    -33.3%
            Max          -1.8%     +4.2%    +10.5%    +10.5%     +7.7%
 Geometric Mean          -2.5%     -2.8%     -0.4%     -0.5%     -0.4%

Things to note

* Binary sizes are smaller. I don't know why, but it's good.

* Allocation is sometiemes a *lot* smaller. I believe that all the big numbers
  (I checked treejoin, gg, sorting) arise from one place, namely a function
  GHC.IO.Encoding.UTF8.utf8_decode, which is strict in two Buffers both of
  which have several arugments.  Not w/w'ing both arguments (which is what
  we did before) has a big effect.  So the big win in actually somewhat
  accidental, gained by removing the "unboxing strategy" code.

* A couple of benchmarks allocate slightly more.  This turns out
  to be due to reboxing (integrate).  But the biggest increase is
  mandel2, and *that* turned out also to be a somewhat accidental
  loss of CSE, and pointed the way to doing better CSE: see Trac

* Runtimes are never very reliable, but seem to improve very slightly.

All in all, a good piece of work.  Thank you Ilya!

6 years agomake it safe to include this after GCTDecl.h
Simon Marlow [Wed, 16 Jan 2013 19:38:56 +0000 (19:38 +0000)] 
make it safe to include this after GCTDecl.h

6 years agoRearrange includes to avoid a clash on ARM/Linux
Simon Marlow [Wed, 16 Jan 2013 19:38:19 +0000 (19:38 +0000)] 
Rearrange includes to avoid a clash on ARM/Linux

6 years agoOutput LLVM version in use at -V2.
David Terei [Thu, 17 Jan 2013 08:29:08 +0000 (00:29 -0800)] 
Output LLVM version in use at -V2.

6 years agoFix floating point constants in LLVM backend (#7600).
David Terei [Thu, 17 Jan 2013 04:16:28 +0000 (20:16 -0800)] 
Fix floating point constants in LLVM backend (#7600).

6 years agoAdd -f[no-]warn-unsupported-llvm-version. Closes Trac #7579.
Austin Seipp [Mon, 14 Jan 2013 04:23:37 +0000 (22:23 -0600)] 
Add -f[no-]warn-unsupported-llvm-version. Closes Trac #7579.

This controls whether or not the compiler warns if we're using an LLVM
version that's too old or too new. It's mostly useful when building the
compiler knowingly with an unsupported version, so you don't get a lot
of warnings in the build process.

There's no documentation for this since it's a flag only a few
developers would care about anyway.

Signed-off-by: Austin Seipp <>
6 years agoAdd a 'quick-llvm' build mode to mk/
Austin Seipp [Sun, 13 Jan 2013 07:52:42 +0000 (01:52 -0600)] 
Add a 'quick-llvm' build mode to mk/

Closes Trac #7572.

Signed-off-by: Austin Seipp <>
6 years agoBetter abstraction over run queues.
Edward Z. Yang [Tue, 15 Jan 2013 23:04:08 +0000 (15:04 -0800)] 
Better abstraction over run queues.

This adds some new functions: peekRunQueue, promoteInRunQueue,
singletonRunQueue and truncateRunQueue which help abstract away
manual linked list manipulation, making it easier to swap in
a new queue implementation.

Signed-off-by: Edward Z. Yang <>
6 years agoMerge branch 'master' of
Simon Peyton Jones [Wed, 16 Jan 2013 15:39:01 +0000 (15:39 +0000)] 
Merge branch 'master' of

6 years agoWhen cross-compiling, pass --host to package configure scripts
Simon Marlow [Wed, 16 Jan 2013 14:18:21 +0000 (14:18 +0000)] 
When cross-compiling, pass --host to package configure scripts

Otherwise the configure script for e.g. base doesn't know that we're
cross-compiling, and fails trying to run an executable compiled by the
C cross-compiler.

6 years agoPass --with-ld=$(LD) to ghc-cabal when configuring packages (#6086)
Simon Marlow [Wed, 16 Jan 2013 14:15:47 +0000 (14:15 +0000)] 
Pass --with-ld=$(LD) to ghc-cabal when configuring packages (#6086)

6 years agoFix Trac #7585.
Richard Eisenberg [Tue, 15 Jan 2013 22:19:37 +0000 (17:19 -0500)] 
Fix Trac #7585.

The coercion optimizer was optimizing coercions inside of branched
axiom applications, sometimes invalidating the branch choice within
the axiom application. Now, we check to make sure we are not
invalidating this invariant before proceeding with the optimization.

6 years agoTiny refactoring, really just white space
Simon Peyton Jones [Tue, 15 Jan 2013 14:57:31 +0000 (14:57 +0000)] 
Tiny refactoring, really just white space

6 years agoTidy up FunDeps.oclose
Simon Peyton Jones [Tue, 15 Jan 2013 14:57:04 +0000 (14:57 +0000)] 
Tidy up FunDeps.oclose

It turned out that FunDeps.oclose was unused. So

* Remove oclose

* Rename oclose1 to oclose

* Move growThetaTyVars to FunDeps (from TcMType),
  because the comments treat it with oclose

* Move quantifyPred to TcSimplify (from TcMType),
  because it seemed orphaned

6 years agoWhite space only
Simon Peyton Jones [Tue, 15 Jan 2013 14:54:37 +0000 (14:54 +0000)] 
White space only

6 years agoWhen doing UNPACK pragmas, be careful to only unpack *data* types not newtypes
Simon Peyton Jones [Tue, 15 Jan 2013 14:52:24 +0000 (14:52 +0000)] 
When doing UNPACK pragmas, be careful to only unpack *data* types not newtypes

This was breaking tc226, following UNPACK-pragma reorg

6 years agoFix up comment: I was just wrong previously, the original GHC comment on `oclose...
Iavor S. Diatchki [Mon, 14 Jan 2013 18:07:04 +0000 (10:07 -0800)] 
Fix up comment:  I was just wrong previously, the original GHC comment on `oclose` is correct.

6 years agoMerge branch 'master' of
Simon Peyton Jones [Mon, 14 Jan 2013 16:46:40 +0000 (16:46 +0000)] 
Merge branch 'master' of

6 years agoBe willing to parse {-# UNPACK #-} without '!'
Simon Peyton Jones [Thu, 10 Jan 2013 16:50:25 +0000 (16:50 +0000)] 
Be willing to parse {-# UNPACK #-} without '!'

This change gives a more helpful error message when the
user says    data T = MkT {-# UNPACK #-} Int
which should have a strictness '!' as well. Rather than
just a parse error, we get

  T7562.hs:3:14: Warning:
    UNPACK pragma lacks '!' on the first argument of `MkT'

Fixes Trac #7562

6 years agoFixup comment: typos + I had the generalization rule backwards.
Iavor S. Diatchki [Mon, 14 Jan 2013 02:34:38 +0000 (18:34 -0800)] 
Fixup comment: typos + I had the generalization rule backwards.

6 years agoUse a version of the coverage condition even with UndecidableInstances.
Iavor S. Diatchki [Mon, 14 Jan 2013 00:29:10 +0000 (16:29 -0800)] 
Use a version of the coverage condition even with UndecidableInstances.

This fixes bug #1241 and #2247.  When UndecidableInstances are on,
we use the "Liberal Coverage Condition", which is what GHC used to do in
the past.  This is the gist of the check:

class C a b | a -> b
instance theta => C t1 t2

we check that `fvs t2` is a subset of `fd-closure(theta,fvs t1)`.

This is strictly more general than the coverage condition, while
it still guarantees consistency with the FDs of the class.  This
check is completely orthogonal to termination (it by no means guarantees

I am not sure of the role of the "coverage condition" in termination---
the comments suggest that it is important.  This is why, for the moment,
we only use this check when UndecidableInstances are on.

6 years agoFix typo in docs; spotted by Gabor Greif
Ian Lynagh [Sat, 12 Jan 2013 16:07:03 +0000 (16:07 +0000)] 
Fix typo in docs; spotted by Gabor Greif

6 years agoClarify docs on when -ddump-* imply -fforce-recomp; fixes #7406
Ian Lynagh [Sat, 12 Jan 2013 12:55:31 +0000 (12:55 +0000)] 
Clarify docs on when -ddump-* imply -fforce-recomp; fixes #7406

6 years agoMerge branch 'master' of
Johan Tibell [Fri, 11 Jan 2013 21:00:41 +0000 (13:00 -0800)] 
Merge branch 'master' of

6 years agoDon't make -C imply -fvia-C
Ian Lynagh [Fri, 11 Jan 2013 18:44:01 +0000 (18:44 +0000)] 
Don't make -C imply -fvia-C

All -fvia-C does nowadays is print a warning saying that it doesn't
do anything.

6 years agoMake "happensBefore" take account of whether we are unregisterised
Ian Lynagh [Fri, 11 Jan 2013 18:42:40 +0000 (18:42 +0000)] 
Make "happensBefore" take account of whether we are unregisterised

If we are not unregisterised then we skip the HCc phase.
Fixes #7563.

6 years agoUpdate a panic message
Ian Lynagh [Fri, 11 Jan 2013 18:03:15 +0000 (18:03 +0000)] 
Update a panic message

I don't actually know if suggesting -fllvm as a workaround is useful
advice, but -fvia-C certainly won't help as it doesn't do anything
any more.

6 years agoWhitespace only in nativeGen/SPARC/Base.hs
Ian Lynagh [Fri, 11 Jan 2013 17:52:22 +0000 (17:52 +0000)] 
Whitespace only in nativeGen/SPARC/Base.hs

6 years agoUpdate a comment
Ian Lynagh [Fri, 11 Jan 2013 17:49:31 +0000 (17:49 +0000)] 
Update a comment

6 years agoRemove checkCOrAsmOrLlvmOrDotNetOrInterp
Ian Lynagh [Fri, 11 Jan 2013 16:57:32 +0000 (16:57 +0000)] 
Remove checkCOrAsmOrLlvmOrDotNetOrInterp

We now just use checkCOrAsmOrLlvmOrInterp instead, which had
an identical definition.

6 years agoImprove some error messages
Ian Lynagh [Fri, 11 Jan 2013 16:56:30 +0000 (16:56 +0000)] 
Improve some error messages

6 years agoUpdate bytestring and terminfo repos
Ian Lynagh [Fri, 11 Jan 2013 14:39:46 +0000 (14:39 +0000)] 
Update bytestring and terminfo repos

bytestring fixes #7556.
terminfo fixes #7281.

6 years agoSmall build system refactoring
Ian Lynagh [Fri, 11 Jan 2013 13:14:29 +0000 (13:14 +0000)] 
Small build system refactoring

hs-suffix-rules now calls hs-suffix-rules-srcdir, saving some duplication

6 years agoBuild system: Add ExtraMakefileSanityChecks for extra safety
Ian Lynagh [Fri, 11 Jan 2013 13:21:51 +0000 (13:21 +0000)] 
Build system: Add ExtraMakefileSanityChecks for extra safety

Whether we check that .hi files have actually been created is now
controlled by $(ExtraMakefileSanityChecks) (defaults to NO).

Also updated comments about the .hi rule.

6 years agodynamic-too progress
Ian Lynagh [Fri, 11 Jan 2013 11:54:23 +0000 (11:54 +0000)] 
dynamic-too progress