ghc.git
7 years agoFix Trac #7237; mixup with empty tuples
Simon Peyton Jones [Sat, 15 Sep 2012 22:06:20 +0000 (23:06 +0100)] 
Fix Trac #7237; mixup with empty tuples

When converting from Core to STG, we swith pattern matching on
on a *nullary* unboxed tuple into matching using a PrimAlt on RealWorld#
   case e (RealWorld#) of { DEFAULT -> ... }
This semms messy to me, but it works.  There was a bug in that we were
changing to PrimAlt, but not using a DEFAULT AltCon.

7 years agoMerge remote branch 'origin/master'
Simon Peyton Jones [Sat, 15 Sep 2012 07:09:56 +0000 (08:09 +0100)] 
Merge remote branch 'origin/master'

7 years agoBind "given" evidence to a variable, always
Simon Peyton Jones [Fri, 14 Sep 2012 23:12:16 +0000 (00:12 +0100)] 
Bind "given" evidence to a variable, always

This was being done in xCtFlavor, but not in rewriteCtFlavor,
resulting in Trac #7238.

See Note [Bind new Givens immediately] in TcSMonad and
and Note [Coercion evidence terms] in TcEvidence.

7 years agoMove wORD_SIZE_IN_BITS to DynFlags
Ian Lynagh [Fri, 14 Sep 2012 20:52:52 +0000 (21:52 +0100)] 
Move wORD_SIZE_IN_BITS to DynFlags

This frees wORD_SIZE up to be moved out of HaskellConstants

7 years agoMove some more constants into platformConstants
Ian Lynagh [Fri, 14 Sep 2012 20:25:46 +0000 (21:25 +0100)] 
Move some more constants into platformConstants

7 years agoRemove more Platform arguments
Ian Lynagh [Fri, 14 Sep 2012 19:20:47 +0000 (20:20 +0100)] 
Remove more Platform arguments

7 years agoWhitespace only in nativeGen/RegAlloc/Linear/JoinToTargets.hs
Ian Lynagh [Fri, 14 Sep 2012 19:10:04 +0000 (20:10 +0100)] 
Whitespace only in nativeGen/RegAlloc/Linear/JoinToTargets.hs

7 years agoRemove more Platform arguments
Ian Lynagh [Fri, 14 Sep 2012 19:04:38 +0000 (20:04 +0100)] 
Remove more Platform arguments

7 years agoRemove a load of Platform arguments from RegM functions
Ian Lynagh [Fri, 14 Sep 2012 18:53:15 +0000 (19:53 +0100)] 
Remove a load of Platform arguments from RegM functions

7 years agoPut DynFlags into the RegM monad
Ian Lynagh [Fri, 14 Sep 2012 18:39:28 +0000 (19:39 +0100)] 
Put DynFlags into the RegM monad

Also moved the type definition into RegAlloc.Linear.State to de-orphan
the Monad instance.

7 years agoWhitespace only in nativeGen/RegAlloc/Linear/State.hs
Ian Lynagh [Fri, 14 Sep 2012 18:28:12 +0000 (19:28 +0100)] 
Whitespace only in nativeGen/RegAlloc/Linear/State.hs

7 years agoMove more constants to platformConstants
Ian Lynagh [Fri, 14 Sep 2012 15:27:51 +0000 (16:27 +0100)] 
Move more constants to platformConstants

7 years agoMAX_REAL_LONG_REG is always defined, so no need to test it
Ian Lynagh [Fri, 14 Sep 2012 14:25:16 +0000 (15:25 +0100)] 
MAX_REAL_LONG_REG is always defined, so no need to test it

7 years agoMove more constants into platformConstants
Ian Lynagh [Fri, 14 Sep 2012 14:24:30 +0000 (15:24 +0100)] 
Move more constants into platformConstants

7 years agoMerge branch 'master' of mac:ghc/git/val32/.
Ian Lynagh [Fri, 14 Sep 2012 12:58:17 +0000 (13:58 +0100)] 
Merge branch 'master' of mac:ghc/git/val32/.

7 years agoMove some more constants fo platformConstants
Ian Lynagh [Fri, 14 Sep 2012 12:57:48 +0000 (13:57 +0100)] 
Move some more constants fo platformConstants

7 years agoMore OS X build fixes
Ian Lynagh [Fri, 14 Sep 2012 12:24:48 +0000 (13:24 +0100)] 
More OS X build fixes

7 years agoCheck for Int constants that are too large in mkDerivedConstants
Ian Lynagh [Fri, 14 Sep 2012 11:53:13 +0000 (12:53 +0100)] 
Check for Int constants that are too large in mkDerivedConstants

7 years agoStart moving other constants from (Haskell)Constants to platformConstants
Ian Lynagh [Fri, 14 Sep 2012 11:48:53 +0000 (12:48 +0100)] 
Start moving other constants from (Haskell)Constants to platformConstants

7 years agoFix build on OS X
Ian Lynagh [Fri, 14 Sep 2012 10:43:12 +0000 (11:43 +0100)] 
Fix build on OS X

7 years agoWhen allocating a new kind variable, do so with newMetaUnique
Simon Peyton Jones [Fri, 14 Sep 2012 10:12:01 +0000 (11:12 +0100)] 
When allocating a new kind variable, do so with newMetaUnique

7 years agoUse intptr_t for offset values in mkDerivedConstants
Ian Lynagh [Thu, 13 Sep 2012 22:31:19 +0000 (23:31 +0100)] 
Use intptr_t for offset values in mkDerivedConstants

This means that we get e.g.
    pc_OFFSET_stgEagerBlackholeInfo = -24
rather than
    pc_OFFSET_stgEagerBlackholeInfo = 18446744073709551592

7 years agoRemove some unused HaskellConstants entries
Ian Lynagh [Thu, 13 Sep 2012 21:16:37 +0000 (22:16 +0100)] 
Remove some unused HaskellConstants entries

7 years agoRemove the --gen-haskell mode of mkDerivedConstants
Ian Lynagh [Thu, 13 Sep 2012 20:26:05 +0000 (21:26 +0100)] 
Remove the --gen-haskell mode of mkDerivedConstants

It no longer generates anything

7 years agoUse oFFSET_* from platformConstants rather than Constants
Ian Lynagh [Thu, 13 Sep 2012 20:22:04 +0000 (21:22 +0100)] 
Use oFFSET_* from platformConstants rather than Constants

7 years agoUse sIZEOF_* from platformConstants rather than Constants
Ian Lynagh [Thu, 13 Sep 2012 18:12:30 +0000 (19:12 +0100)] 
Use sIZEOF_* from platformConstants rather than Constants

7 years agoAdd a couple more mkDerivedConstants modes
Ian Lynagh [Thu, 13 Sep 2012 17:00:39 +0000 (18:00 +0100)] 
Add a couple more mkDerivedConstants modes

We now also generate nice wrappers for the platformConstants
methods. For now it's all commented out as the definitions
conflict with those in Constants.

7 years agoWe need to install the platformConstants file
Ian Lynagh [Thu, 13 Sep 2012 16:32:13 +0000 (17:32 +0100)] 
We need to install the platformConstants file

7 years agoMake the Windows-specific part of mkDerivedConstants.c conditional
Ian Lynagh [Thu, 13 Sep 2012 15:10:32 +0000 (16:10 +0100)] 
Make the Windows-specific part of mkDerivedConstants.c conditional

It is only generated when mode is Gen_Header; i.e. it's not used
in the compiler, only the RTS.

7 years agoAdd more modes to mkDerivedConstants
Ian Lynagh [Thu, 13 Sep 2012 11:54:04 +0000 (12:54 +0100)] 
Add more modes to mkDerivedConstants

We now generate a platformConstants file that we can read at runtime.

7 years agoUse conditionals rather than CPP in mkDerivedConstants
Ian Lynagh [Wed, 12 Sep 2012 22:34:27 +0000 (23:34 +0100)] 
Use conditionals rather than CPP in mkDerivedConstants

This means we only need to build one copy of the program, which
will make life simpler as I plan to add more variants.

7 years agoPass DynFlags down to wordWidth
Ian Lynagh [Wed, 12 Sep 2012 15:32:34 +0000 (16:32 +0100)] 
Pass DynFlags down to wordWidth

7 years agoPass DynFlags down to gcWord
Ian Lynagh [Wed, 12 Sep 2012 11:37:01 +0000 (12:37 +0100)] 
Pass DynFlags down to gcWord

7 years agoPass DynFlags down to bWord
Ian Lynagh [Wed, 12 Sep 2012 10:31:11 +0000 (11:31 +0100)] 
Pass DynFlags down to bWord

I've switched to passing DynFlags rather than Platform, as (a) it's
simpler to not have to extract targetPlatform in so many places, and
(b) it may be useful to have DynFlags around in future.

7 years agoWhitespace only in codeGen/CgProf.hs
Ian Lynagh [Tue, 11 Sep 2012 14:10:28 +0000 (15:10 +0100)] 
Whitespace only in codeGen/CgProf.hs

7 years agoWhitespace only in cmm/CmmUtils.hs
Ian Lynagh [Tue, 11 Sep 2012 12:48:21 +0000 (13:48 +0100)] 
Whitespace only in cmm/CmmUtils.hs

7 years agoWhitespace only in cmm/CmmExpr.hs
Ian Lynagh [Tue, 11 Sep 2012 12:45:43 +0000 (13:45 +0100)] 
Whitespace only in cmm/CmmExpr.hs

7 years agoPass Platform down to halfWordMask
Ian Lynagh [Mon, 10 Sep 2012 16:04:41 +0000 (17:04 +0100)] 
Pass Platform down to halfWordMask

7 years agoPass Platform down to halfWordWidth
Ian Lynagh [Mon, 10 Sep 2012 16:02:50 +0000 (17:02 +0100)] 
Pass Platform down to halfWordWidth

We don't actually use it yet

7 years agoRemove some more CPP
Ian Lynagh [Mon, 10 Sep 2012 12:14:45 +0000 (13:14 +0100)] 
Remove some more CPP

7 years agoTwo fixes to kind unification
Simon Peyton Jones [Mon, 10 Sep 2012 12:13:24 +0000 (13:13 +0100)] 
Two fixes to kind unification

* Don't unify a kind signature-variable with non-tyvar kind
* Don't allow a kind variable to appear in a type
  (Trac #7224)

7 years agoRemove some CPP
Ian Lynagh [Mon, 10 Sep 2012 11:45:34 +0000 (12:45 +0100)] 
Remove some CPP

7 years agoMerge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
Ian Lynagh [Mon, 10 Sep 2012 10:29:31 +0000 (11:29 +0100)] 
Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc

7 years agoUpdate dependency on directory.
Paolo Capriotti [Tue, 14 Aug 2012 11:59:21 +0000 (12:59 +0100)] 
Update dependency on directory.

7 years agoRemember to zonk the skolems of an implication
Simon Peyton Jones [Sun, 9 Sep 2012 06:07:39 +0000 (07:07 +0100)] 
Remember to zonk the skolems of an implication

Their kinds may contain kind unification variables!

This patch fixes Trac #7230.

7 years agoLots of nat -> StgWord changes
Simon Marlow [Fri, 7 Sep 2012 15:01:36 +0000 (16:01 +0100)] 
Lots of nat -> StgWord changes

7 years agocomment updates
Simon Marlow [Fri, 7 Sep 2012 15:01:09 +0000 (16:01 +0100)] 
comment updates

7 years agoHandle II16 size value in PowerPC code generator.
Erik de Castro Lopo [Fri, 7 Sep 2012 10:12:38 +0000 (20:12 +1000)] 
Handle II16 size value in PowerPC code generator.

7 years agoDeprecate lnat, and use StgWord instead
Simon Marlow [Fri, 7 Sep 2012 12:55:11 +0000 (13:55 +0100)] 
Deprecate lnat, and use StgWord instead

lnat was originally "long unsigned int" but we were using it when we
wanted a 64-bit type on a 64-bit machine.  This broke on Windows x64,
where long == int == 32 bits.  Using types of unspecified size is bad,
but what we really wanted was a type with N bits on an N-bit machine.
StgWord is exactly that.

lnat was mentioned in some APIs that clients might be using
(e.g. StackOverflowHook()), so we leave it defined but with a comment
to say that it's deprecated.

7 years agoSome further tweaks to reduce fragmentation when allocating the nursery
Simon Marlow [Fri, 7 Sep 2012 12:36:09 +0000 (13:36 +0100)] 
Some further tweaks to reduce fragmentation when allocating the nursery

7 years agosome nats should be lnats
Simon Marlow [Fri, 7 Sep 2012 12:35:27 +0000 (13:35 +0100)] 
some nats should be lnats

7 years agoWhen using -H with -M<size>, don't exceed the maximum heap size
Simon Marlow [Fri, 7 Sep 2012 12:35:16 +0000 (13:35 +0100)] 
When using -H with -M<size>, don't exceed the maximum heap size

7 years agomemInventory(): tweak pretty-printing
Simon Marlow [Fri, 7 Sep 2012 12:35:00 +0000 (13:35 +0100)] 
memInventory(): tweak pretty-printing

7 years agoFix the PPC and SPARC NCGs to handle multiple info tables in a proc
Simon Marlow [Fri, 7 Sep 2012 11:50:08 +0000 (12:50 +0100)] 
Fix the PPC and SPARC NCGs to handle multiple info tables in a proc

7 years agoTypo fix in deferred type errors docs.
Edward Z. Yang [Thu, 6 Sep 2012 18:24:36 +0000 (14:24 -0400)] 
Typo fix in deferred type errors docs.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
7 years agoFail nicely when encountering an invalid bang annotation (#7210)
Patrick Palka [Mon, 3 Sep 2012 14:27:26 +0000 (10:27 -0400)] 
Fail nicely when encountering an invalid bang annotation (#7210)

7 years agoFix #7215: we weren't calculating the hashes correctly for sub-binders
Simon Marlow [Wed, 5 Sep 2012 15:38:50 +0000 (16:38 +0100)] 
Fix #7215: we weren't calculating the hashes correctly for sub-binders

7 years agoremove $(GhcStage1DefaultNewCodegen) etc.
Simon Marlow [Wed, 5 Sep 2012 08:26:23 +0000 (09:26 +0100)] 
remove $(GhcStage1DefaultNewCodegen) etc.

7 years agoA further fix for -split-objs with the new codegen
Simon Marlow [Wed, 5 Sep 2012 08:23:04 +0000 (09:23 +0100)] 
A further fix for -split-objs with the new codegen

7 years agoAdd "remote set-branches" support to sync-all
Ian Lynagh [Tue, 4 Sep 2012 13:57:22 +0000 (14:57 +0100)] 
Add "remote set-branches" support to sync-all

7 years agoFix -split-objs with the new code generator
Simon Marlow [Tue, 4 Sep 2012 12:57:26 +0000 (13:57 +0100)] 
Fix -split-objs with the new code generator

We need to make the SRT label external and unique when splitting,
because it is shared amongst all the functions in the module.  Also
some SRT-related cleanup.

7 years agoNarrow the args of the popCnt# primitives (new codegen)
Simon Marlow [Mon, 3 Sep 2012 11:28:35 +0000 (12:28 +0100)] 
Narrow the args of the popCnt# primitives (new codegen)

(this change was previously done in the old codegen only)

7 years agoMake -fhpc a dynamic flag
Ian Lynagh [Mon, 3 Sep 2012 22:42:17 +0000 (23:42 +0100)] 
Make -fhpc a dynamic flag

7 years agoRemove unused -dopt-fuel
Ian Lynagh [Mon, 3 Sep 2012 21:42:07 +0000 (22:42 +0100)] 
Remove unused -dopt-fuel

7 years agoRemove -dstub-dead-values from flag list
Ian Lynagh [Mon, 3 Sep 2012 21:39:28 +0000 (22:39 +0100)] 
Remove -dstub-dead-values from flag list

7 years agoMake -fhistory-size dynamic
Ian Lynagh [Mon, 3 Sep 2012 21:22:34 +0000 (22:22 +0100)] 
Make -fhistory-size dynamic

7 years agoRemove the unused opt_StubDeadValues
Ian Lynagh [Mon, 3 Sep 2012 20:49:16 +0000 (21:49 +0100)] 
Remove the unused opt_StubDeadValues

7 years agoMove ldInputs into DynFlags
Ian Lynagh [Mon, 3 Sep 2012 20:41:55 +0000 (21:41 +0100)] 
Move ldInputs into DynFlags

7 years agoMerge branch 'master' of darcs.haskell.org:/srv/darcs//ghc
Ian Lynagh [Mon, 3 Sep 2012 17:20:03 +0000 (18:20 +0100)] 
Merge branch 'master' of darcs.haskell.org:/srv/darcs//ghc

7 years agoRemove the way-related CPP frmo DynFlags
Ian Lynagh [Mon, 3 Sep 2012 16:41:11 +0000 (17:41 +0100)] 
Remove the way-related CPP frmo DynFlags

7 years agoRemove doingTickyProfiling
Ian Lynagh [Mon, 3 Sep 2012 16:25:47 +0000 (17:25 +0100)] 
Remove doingTickyProfiling

It's now just 'dopt Opt_Ticky'

7 years agoDefine initial buildTag and rtsBuildTag
Ian Lynagh [Mon, 3 Sep 2012 16:09:11 +0000 (17:09 +0100)] 
Define initial buildTag and rtsBuildTag

7 years agoMake the ways dynamic
Ian Lynagh [Mon, 3 Sep 2012 16:02:18 +0000 (17:02 +0100)] 
Make the ways dynamic

7 years agoRefactor the ways code a bit
Ian Lynagh [Mon, 3 Sep 2012 10:58:48 +0000 (11:58 +0100)] 
Refactor the ways code a bit

We used to use a list lookup that couldn't fail. Now we just use
functions.

There were 3 overlapping entries for WayPar; I've commented out the ones
that were shadowed for now.

7 years agoDisable the MR by default in GHCi (#3202)
Paolo Capriotti [Sun, 2 Sep 2012 16:40:51 +0000 (17:40 +0100)] 
Disable the MR by default in GHCi (#3202)

7 years agoLoad the PIC base register on every entry point
Simon Marlow [Fri, 31 Aug 2012 15:31:34 +0000 (16:31 +0100)] 
Load the PIC base register on every entry point

(fixes dyn tests with -fnew-codegen on x86)

7 years agoAdd -fcmm-sink to avoid the register allocator failing on x86
Simon Marlow [Fri, 31 Aug 2012 09:46:08 +0000 (10:46 +0100)] 
Add -fcmm-sink to avoid the register allocator failing on x86

7 years agoNarrow the arg of popCnt# to the correct width
Simon Marlow [Wed, 29 Aug 2012 13:50:14 +0000 (14:50 +0100)] 
Narrow the arg of popCnt# to the correct width

Fixes cgrun071 on recent Mac OS X versions.

This is the right fix at least until we have proper types for Word8#,
Word16# etc.

7 years agofix the name of an SCC
Simon Marlow [Wed, 29 Aug 2012 11:50:46 +0000 (12:50 +0100)] 
fix the name of an SCC

7 years agodebug printing of the CAFEnv
Simon Marlow [Wed, 29 Aug 2012 11:50:36 +0000 (12:50 +0100)] 
debug printing of the CAFEnv

7 years agosmall improvements to findPtr() and the closure printer
Simon Marlow [Wed, 29 Aug 2012 11:50:08 +0000 (12:50 +0100)] 
small improvements to findPtr() and the closure printer

7 years agoFix a bug in foldExpDeep
Simon Marlow [Wed, 29 Aug 2012 11:48:40 +0000 (12:48 +0100)] 
Fix a bug in foldExpDeep

This caused the CAF analysis to occasionally miss a CAF sometimes,
resulting in a very hard to diagnose crash.

7 years agodisable -fregs-graph (#7192)
Simon Marlow [Tue, 28 Aug 2012 15:10:48 +0000 (16:10 +0100)] 
disable -fregs-graph (#7192)

7 years agoenable -fnew-codegen by default
Simon Marlow [Tue, 28 Aug 2012 15:10:32 +0000 (16:10 +0100)] 
enable -fnew-codegen by default

7 years agoCleanup: add mkIntExpr and zeroExpr utils
Simon Marlow [Tue, 28 Aug 2012 15:09:50 +0000 (16:09 +0100)] 
Cleanup: add mkIntExpr and zeroExpr utils

7 years agoFix fencepost and byte/word bugs in cloneArray/copyArray (#7185)
Simon Marlow [Tue, 28 Aug 2012 14:52:38 +0000 (15:52 +0100)] 
Fix fencepost and byte/word bugs in cloneArray/copyArray (#7185)

7 years agomake sure to remove the right link before calling 'ln -s' (could we use 'ln -sf'?)
Gabor Greif [Thu, 30 Aug 2012 13:02:56 +0000 (15:02 +0200)] 
make sure to remove the right link before calling 'ln -s' (could we use 'ln -sf'?)

7 years agov7.4.1 is required for building, so we can drop the v7.2.1 workaround
Gabor Greif [Wed, 29 Aug 2012 12:47:02 +0000 (14:47 +0200)] 
v7.4.1 is required for building, so we can drop the v7.2.1 workaround

7 years agoFail earlier if there's an error in a type declaration
Simon Peyton Jones [Wed, 29 Aug 2012 10:33:33 +0000 (11:33 +0100)] 
Fail earlier if there's an error in a type declaration

This change means that we don't recover from erroneous type
declarations, thereby reporting fewer errors.  But trying to
recover confused GHC (leading to a pattern match failure in
the compiler Trac #7175), and it turned out to be tricky
to fix that.

So this patch takes the more conservative path of failing
earlier, perhaps reporting fewer real errors.

7 years agoFix Trac #7196 by adding a case to the desugarer
Simon Peyton Jones [Wed, 29 Aug 2012 09:57:48 +0000 (10:57 +0100)] 
Fix Trac #7196 by adding a case to the desugarer

Pls merge to 7.6

7 years agoMerge branch 'master' of http://darcs.haskell.org/ghc
Simon Peyton Jones [Wed, 29 Aug 2012 06:35:23 +0000 (07:35 +0100)] 
Merge branch 'master' of darcs.haskell.org/ghc

7 years agoRemove CPP from coreSyn/CoreUtils.lhs
Ian Lynagh [Tue, 28 Aug 2012 23:10:44 +0000 (00:10 +0100)] 
Remove CPP from coreSyn/CoreUtils.lhs

7 years agoAdd DynFlags to the CorePrepEnv
Ian Lynagh [Tue, 28 Aug 2012 23:01:57 +0000 (00:01 +0100)] 
Add DynFlags to the CorePrepEnv

7 years agoRemove CPP from cmm/CmmParse.y
Ian Lynagh [Tue, 28 Aug 2012 22:40:16 +0000 (23:40 +0100)] 
Remove CPP from cmm/CmmParse.y

7 years agoWhitespace only in cmm/CmmParse.y
Ian Lynagh [Tue, 28 Aug 2012 22:33:50 +0000 (23:33 +0100)] 
Whitespace only in cmm/CmmParse.y

7 years agoRemove some CPP from nativeGen/X86/Instr.hs
Ian Lynagh [Tue, 28 Aug 2012 22:26:40 +0000 (23:26 +0100)] 
Remove some CPP from nativeGen/X86/Instr.hs

7 years agoRemove some CPP from compiler/ghci/Linker.lhs
Ian Lynagh [Tue, 28 Aug 2012 22:22:28 +0000 (23:22 +0100)] 
Remove some CPP from compiler/ghci/Linker.lhs

7 years agoRemove Util.{isDarwinTarget,isWindowsTarget}
Ian Lynagh [Tue, 28 Aug 2012 21:46:31 +0000 (22:46 +0100)] 
Remove Util.{isDarwinTarget,isWindowsTarget}

7 years agoRemove some CPP from llvmGen/LlvmCodeGen/Ppr.hs
Ian Lynagh [Tue, 28 Aug 2012 20:27:02 +0000 (21:27 +0100)] 
Remove some CPP from llvmGen/LlvmCodeGen/Ppr.hs

I changed the behaviour slightly, e.g. i386/FreeBSD will no longer
fall through and use the Linux "i386-pc-linux-gnu", but will get the
final empty case instead. I assume that that's the right thing to do.

7 years agoRemove some CPP from nativeGen/PPC/Regs.h
Ian Lynagh [Tue, 28 Aug 2012 20:07:15 +0000 (21:07 +0100)] 
Remove some CPP from nativeGen/PPC/Regs.h