12 years agocheck for unreachable code only with -DDEBUG
Norman Ramsey [Tue, 11 Sep 2007 14:24:10 +0000 (14:24 +0000)] 
check for unreachable code only with -DDEBUG

12 years agoadd a big diagnostic for failures in CmmCvt.toZgraph
Norman Ramsey [Tue, 11 Sep 2007 14:23:38 +0000 (14:23 +0000)] 
add a big diagnostic for failures in CmmCvt.toZgraph

12 years agoDon't try and coalesce nodes with themselves [Tue, 11 Sep 2007 15:12:11 +0000 (15:12 +0000)] 
Don't try and coalesce nodes with themselves

12 years agoTry and allocate vregs spilled/reloaded from some slot to the same hreg [Tue, 11 Sep 2007 14:50:54 +0000 (14:50 +0000)] 
Try and allocate vregs spilled/reloaded from some slot to the same hreg

12 years agoBetter handling of live range joins via spill slots in spill cleaner [Tue, 11 Sep 2007 13:02:47 +0000 (13:02 +0000)] 
Better handling of live range joins via spill slots in spill cleaner

12 years agoMake sure to coalesce all the nodes found during iterative scanning [Mon, 10 Sep 2007 16:29:09 +0000 (16:29 +0000)] 
Make sure to coalesce all the nodes found during iterative scanning

12 years agoAdd iterative coalescing to graph coloring allocator [Fri, 7 Sep 2007 17:23:15 +0000 (17:23 +0000)] 
Add iterative coalescing to graph coloring allocator

Iterative coalescing interleaves conservative coalesing with the regular
simplify/scan passes. This increases the chance that nodes will be coalesced
as they will have a lower degree than at the beginning of simplify. The end
result is that more register to register moves will be eliminated in the
output code, though the iterative nature of the algorithm makes it slower
compared to non-iterative coloring.

Use -fregs-iterative  for graph coloring allocation with iterative coalescing
    -fregs-graph      for non-iterative coalescing.

The plan is for iterative coalescing to be enabled with -O2 and have a
quicker, non-iterative algorithm otherwise. The time/benefit tradeoff
between iterative and not is still being tuned - optimal graph coloring
is NP-hard, afterall..

12 years agoCustom printer for the Term datatype that won't output TypeRep values
Pepe Iborra [Tue, 11 Sep 2007 15:14:54 +0000 (15:14 +0000)] 
Custom printer for the Term datatype that won't output TypeRep values

The term pretty printer used by :print shouldn't output
the contents of TypeRep values, e.g. inside Dynamic values

12 years agoFIX #1466 (partly), which was causing concprog001(ghci) to fail
Simon Marlow [Tue, 11 Sep 2007 13:02:28 +0000 (13:02 +0000)] 
FIX #1466 (partly), which was causing concprog001(ghci) to fail
An AP_STACK now ensures that there is at least AP_STACK_SPLIM words of
stack headroom available after unpacking the payload.  Continuations
that require more than AP_STACK_SPLIM words of stack must do their own
stack checks instead of aggregating their stack usage into the parent
frame.  I have made this change for the interpreter, but not for
compiled code yet - we should do this in the glorious rewrite of the
code generator.

12 years agoFix type signatures
Pepe Iborra [Tue, 11 Sep 2007 11:32:12 +0000 (11:32 +0000)] 
Fix type signatures

12 years agoDocumentation for -fbreak-on-error
Pepe Iborra [Tue, 11 Sep 2007 10:19:44 +0000 (10:19 +0000)] 
Documentation for -fbreak-on-error

12 years agoGHCi debugger: new flag -fbreak-on-error
Pepe Iborra [Tue, 11 Sep 2007 10:14:43 +0000 (10:14 +0000)] 
GHCi debugger: new flag -fbreak-on-error

    This flag works like -fbreak-on-exception, but only stops
    on uncaught exceptions.

12 years agoRemove obsolete -fdebugging flag
Pepe Iborra [Fri, 7 Sep 2007 13:58:57 +0000 (13:58 +0000)] 
Remove obsolete -fdebugging flag

A left over from the 1st GHCi debugger prototype

12 years agorefactoring: eliminate DriverPipeline.CompResult and GHC.upsweep_compile
Simon Marlow [Mon, 10 Sep 2007 14:57:47 +0000 (14:57 +0000)] 
refactoring: eliminate DriverPipeline.CompResult and GHC.upsweep_compile

12 years agorefactoring: inline hscMkCompiler
Simon Marlow [Mon, 10 Sep 2007 14:57:18 +0000 (14:57 +0000)] 
refactoring: inline hscMkCompiler

12 years agoFIX #1677; poor error message for misspelled module declaration
Simon Marlow [Tue, 11 Sep 2007 08:54:52 +0000 (08:54 +0000)] 
FIX #1677; poor error message for misspelled module declaration

12 years agoSynched documentation links with current directory layout [Tue, 11 Sep 2007 07:18:01 +0000 (07:18 +0000)] 
Synched documentation links with current directory layout
Somehow the "html" subdirs are gone, this change was not completely
intentional, but it is nice, anyway. Those subdirs never served any
real purpose...


12 years agoAdd a BeConservative setting to the make system
Ian Lynagh [Mon, 10 Sep 2007 13:35:28 +0000 (13:35 +0000)] 
Add a BeConservative setting to the make system
If it is set, we don't try to use clock_gettime

12 years agoNicer GHCi debugger underlining
Pepe Iborra [Mon, 10 Sep 2007 14:53:19 +0000 (14:53 +0000)] 
Nicer GHCi debugger underlining

Improved the underlining of blocks.
With this patch it does:

Stopped at break020.hs:(6,20)-(7,29)
_result :: t1 () = _
6  in_another_decl _ = do line1 0
7                         line2 0

Instead of

Stopped at break020.hs:(6,20)-(7,29)
_result :: t1 () = _
6  in_another_decl _ = do line1 0
7                         line2 0

12 years agoFIX #1669 (GHCi debugger underlining is in the wrong place)
Pepe Iborra [Mon, 10 Sep 2007 14:21:29 +0000 (14:21 +0000)] 
FIX #1669 (GHCi debugger underlining is in the wrong place)

We weren't taking into account the offset added by the line numbers:

Stopped at break020.hs:10:2-8
_result :: IO () = _
9  main = do
10    line1 0
11    line2 0

This patch adjusts that

12 years agoTurn off orphan warnings
Ian Lynagh [Mon, 10 Sep 2007 12:27:56 +0000 (12:27 +0000)] 
Turn off orphan warnings
We also avoid using -fno-warn-orphans with older GHCs that don't understand
the flag.

12 years agoAdd some more bits to the boring file
Ian Lynagh [Fri, 7 Sep 2007 21:22:08 +0000 (21:22 +0000)] 
Add some more bits to the boring file

12 years agoAdd a --names-only flag for list --simple-output
Ian Lynagh [Fri, 7 Sep 2007 18:19:44 +0000 (18:19 +0000)] 
Add a --names-only flag for list --simple-output
We use this in the testsuite to find out which libraries we should run
the tests from.

12 years agoFIX #903: mkWWcpr: not a product
Simon Marlow [Mon, 10 Sep 2007 10:38:30 +0000 (10:38 +0000)] 
FIX #903: mkWWcpr: not a product
This fixes the long-standing bug that prevents some code with
mutally-recursive modules from being compiled with --make and -O,
including GHC itself.  See the comments for details.

There are some additional cleanups that were forced/enabled by this
patch: I removed importedSrcLoc/importedSrcSpan: it wasn't adding any
useful information, since a Name already contains its defining Module.
In fact when re-typechecking an interface file we were wrongly
replacing the interesting SrcSpans in the Names with boring
importedSrcSpans, which meant that location information could degrade
after reloading modules.  Also, recreating all these Names was a waste
of space/time.

12 years agoCleaned up version of Tom's unflattened skolemOccurs
Manuel M T Chakravarty [Mon, 10 Sep 2007 08:34:57 +0000 (08:34 +0000)] 
Cleaned up version of Tom's unflattened skolemOccurs

12 years agoThe RTS is Haddock-less, tell make about it [Mon, 10 Sep 2007 06:57:59 +0000 (06:57 +0000)] 
The RTS is Haddock-less, tell make about it

12 years agoInclude package documentation, n-th attempt... [Sun, 9 Sep 2007 15:40:53 +0000 (15:40 +0000)] 
Include package documentation, n-th attempt...

12 years agoYet another attempt to get the paths for the installed documentation correct [Sun, 9 Sep 2007 12:49:22 +0000 (12:49 +0000)] 
Yet another attempt to get the paths for the installed documentation correct

12 years agoAdd a "show" target here, too, quite useful for debugging the build process [Sun, 9 Sep 2007 12:38:13 +0000 (12:38 +0000)] 
Add a "show" target here, too, quite useful for debugging the build process

12 years agoNever try to build Haddock docs in ghc/compiler, even with HADDOCK_DOCS=YES [Sun, 9 Sep 2007 12:34:01 +0000 (12:34 +0000)] 
Never try to build Haddock docs in ghc/compiler, even with HADDOCK_DOCS=YES

12 years agoRemoved install-dirs target, it is unnecessary and leads to stray empty directories [Sun, 9 Sep 2007 12:11:57 +0000 (12:11 +0000)] 
Removed install-dirs target, it is unnecessary and leads to stray empty directories

12 years agoRemoved install-dirs from phony targets, it is unused [Sun, 9 Sep 2007 10:28:15 +0000 (10:28 +0000)] 
Removed install-dirs from phony targets, it is unused

12 years agoAdd a crucial missing ;
Ian Lynagh [Sat, 8 Sep 2007 23:10:24 +0000 (23:10 +0000)] 
Add a crucial missing ;

12 years agoimplement the outOfLine primitive in MkZipCfg (proposed as mkBlock)
Norman Ramsey [Sat, 8 Sep 2007 15:51:41 +0000 (15:51 +0000)] 
implement the outOfLine primitive in MkZipCfg (proposed as mkBlock)

12 years agowithUnique and mkBlock as requested by SLPJ (but only one is implemented)
Norman Ramsey [Fri, 7 Sep 2007 17:20:30 +0000 (17:20 +0000)] 
withUnique and mkBlock as requested by SLPJ (but only one is implemented)

12 years agono registers are available after a call
Norman Ramsey [Fri, 7 Sep 2007 17:08:43 +0000 (17:08 +0000)] 
no registers are available after a call

12 years agowrote an analysis to help in sinking Reload instructions
Norman Ramsey [Fri, 7 Sep 2007 16:59:55 +0000 (16:59 +0000)] 
wrote an analysis to help in sinking Reload instructions

12 years agoWe seem to use Outputable unconditionally these days [Sat, 8 Sep 2007 14:27:12 +0000 (14:27 +0000)] 
We seem to use Outputable unconditionally these days

12 years agoRemoved setting of default values for variables which are never empty [Sat, 8 Sep 2007 13:18:09 +0000 (13:18 +0000)] 
Removed setting of default values for variables which are never empty
The standard autoconf variables like prefix, exec_prefix, ... are always set by
configure, so there is no need to provide explicit defaults in the Makefile.

The lines were introduced about a decade ago, perhaps there were some bugs in
ancient autoconfs, but today I can't think of a reason why this should be still

12 years agoUse := for PACKAGE_TARNAME, no reason for not doing so [Sat, 8 Sep 2007 12:46:45 +0000 (12:46 +0000)] 
Use := for PACKAGE_TARNAME, no reason for not doing so

12 years agoRemoved unused oldincludedir, things are already complicated enough [Sat, 8 Sep 2007 12:44:48 +0000 (12:44 +0000)] 
Removed unused oldincludedir, things are already complicated enough

12 years agoAdded comment about GNU coding standards/autoconf history [Sat, 8 Sep 2007 12:33:17 +0000 (12:33 +0000)] 
Added comment about GNU coding standards/autoconf history

12 years agoFixing Hpc's Finite Map compat lib for ghc 6.2.1 [Sat, 8 Sep 2007 05:53:20 +0000 (05:53 +0000)] 
Fixing Hpc's Finite Map compat lib for ghc 6.2.1

12 years agoupdating hpc toolkit [Sat, 8 Sep 2007 05:16:00 +0000 (05:16 +0000)] 
updating hpc toolkit

The hpc overlay has been ported from hpc-0.4
The new API for readMix is now used.

12 years agoFixing hpc to allow use of hash function to seperate source files on source path [Fri, 7 Sep 2007 22:33:57 +0000 (22:33 +0000)] 
Fixing hpc to allow use of hash function to seperate source files on source path

12 years agoMake various assertions work when !DEBUG
Ian Lynagh [Sat, 8 Sep 2007 00:31:12 +0000 (00:31 +0000)] 
Make various assertions work when !DEBUG

12 years agoFix assertions in RtClosureInspect
Ian Lynagh [Fri, 7 Sep 2007 23:33:30 +0000 (23:33 +0000)] 
Fix assertions in RtClosureInspect

12 years agoIn ASSERT and friends, use all the expressions we are passed even if !DEBUG
Ian Lynagh [Fri, 7 Sep 2007 23:33:24 +0000 (23:33 +0000)] 
In ASSERT and friends, use all the expressions we are passed even if !DEBUG
Otherwise we may get unused variable warnings. GHC should optimise them
all out for us.

12 years agoDon't put directories for unbuildable libraries in bindists
Ian Lynagh [Fri, 7 Sep 2007 21:00:37 +0000 (21:00 +0000)] 
Don't put directories for unbuildable libraries in bindists
We think there is a library there, and then installPackage fails to
install it.

12 years agoa good deal of salutory renaming
Norman Ramsey [Fri, 7 Sep 2007 16:12:46 +0000 (16:12 +0000)] 
a good deal of salutory renaming
I've renamed a number of type and data constructors within Cmm so that
the names used in the compiler may more closely reflect the C--
specification 2.1.  I've done a bit of other renaming as well.

  CmmFormal and CmmActual now bear a CmmKind (which for now is a
                                              MachHint as before)
  CmmFormals = [CmmFormal] and CmmActuals = [CmmActual]

  suitable changes have been made to both code and nonterminals in the
  Cmm parser (which is as yet untested)

  For reasons I don't understand, parts of the code generator use a
  sequence of 'formal parameters' with no C-- kinds.  For these we now
  have the types
    type CmmFormalWithoutKind   = LocalReg
    type CmmFormalsWithoutKinds = [CmmFormalWithoutKind]

  A great many appearances of (Tau, MachHint) have been simplified to
  the appropriate CmmFormal or CmmActual, though I'm sure there are
  more opportunities.

  Kind and its data constructors are now renamed to
     data GCKind = GCKindPtr | GCKindNonPtr
  to avoid confusion with the Kind used in the type checker and with CmmKind.

Finally, in a somewhat unrelated bit (and in honor of Simon PJ, who
thought of the name), the Whalley/Davidson 'transaction limit' is now
called 'OptimizationFuel' with the net effect that there are no longer
two unrelated uses of the abbreviation 'tx'.

12 years agoMade TcTyFuns warning clean
Manuel M T Chakravarty [Fri, 7 Sep 2007 12:11:13 +0000 (12:11 +0000)] 
Made TcTyFuns warning clean

12 years agofix for Simple9
Tom Schrijvers [Thu, 6 Sep 2007 17:17:03 +0000 (17:17 +0000)] 
fix for Simple9

No longer include non-indexed arguments
in lookup of matching type function clause.
By including non-indexed (additional) arguments,
the lookup always fails.

12 years agoImproved error messages for higher-rank equality contexts
Manuel M T Chakravarty [Fri, 7 Sep 2007 10:19:01 +0000 (10:19 +0000)] 
Improved error messages for higher-rank equality contexts

12 years agoFIX: Type families test Simple14
Manuel M T Chakravarty [Fri, 7 Sep 2007 09:22:17 +0000 (09:22 +0000)] 
FIX: Type families test Simple14

12 years agorefactor duplicated code in main/HscMain
Norman Ramsey [Fri, 7 Sep 2007 13:24:42 +0000 (13:24 +0000)] 
refactor duplicated code in main/HscMain
  I kept making mistakes because all the ZipCfg and CPS stuff
  was called from two different places (compiling Haskell and
  compiling Cmm).  Now it is called from a single place, and therefore
  successfully turned off by default.

  I still don't know why turning it on causes rts/Apply.cmm not to
  compile; that development is new since yesterday.

12 years agoin CmmExpr, always have (Show GlobalReg), regardless of DEBUG setting
Norman Ramsey [Fri, 7 Sep 2007 13:24:17 +0000 (13:24 +0000)] 
in CmmExpr, always have (Show GlobalReg), regardless of DEBUG setting

12 years agoRejig boot
Ian Lynagh [Fri, 7 Sep 2007 12:28:47 +0000 (12:28 +0000)] 
Rejig boot
find on Windows doesn't understand -L, so stop trying to be clever and
just autoreconf everything.

Also, print out the names of directories as we autoreconf them, so that
if autoreconfing one breaks then we know which one it was.

12 years agoFix publishing
Ian Lynagh [Fri, 7 Sep 2007 12:14:14 +0000 (12:14 +0000)] 
Fix publishing
Paths like c:/foo/bar get misinterpreted by rsync (really SSH?), as it
thinks we want /foo/bar on the machine c.

12 years agoFix building with old compilers which don't understand -fno-warn-orphans
Ian Lynagh [Thu, 6 Sep 2007 19:57:37 +0000 (19:57 +0000)] 
Fix building with old compilers which don't understand -fno-warn-orphans

12 years agoTiny optimisation/simplification to FunDeps.grow [Fri, 7 Sep 2007 10:11:33 +0000 (10:11 +0000)] 
Tiny optimisation/simplification to FunDeps.grow

12 years agoWarning police [Fri, 7 Sep 2007 10:11:03 +0000 (10:11 +0000)] 
Warning police

12 years agoAdd clarifying comments [Fri, 7 Sep 2007 10:10:46 +0000 (10:10 +0000)] 
Add clarifying comments

12 years agoFix zonking in mkExports [Thu, 6 Sep 2007 09:03:46 +0000 (09:03 +0000)] 
Fix zonking in mkExports

I'd missed zonk, so that an error message for missing type signature
read (unhelpfully)

     Warning: Definition but no type signature for `upsweep''
              Inferred type: upsweep' :: forall t1. t

The trouble was that 't' hadn't been zonked.

Push to the stable branch

12 years agoadding new files to do with new cmm functionality
Norman Ramsey [Fri, 7 Sep 2007 07:57:54 +0000 (07:57 +0000)] 
adding new files to do with new cmm functionality

12 years agoSet do_bold based on $TERM, not platform
Ian Lynagh [Thu, 6 Sep 2007 17:55:35 +0000 (17:55 +0000)] 
Set do_bold based on $TERM, not platform

12 years agoUpdates to work with latest cabal.
Duncan Coutts [Thu, 6 Sep 2007 13:17:26 +0000 (13:17 +0000)] 
Updates to work with latest cabal.

12 years agomassive changes to add a 'zipper' representation of C--
Norman Ramsey [Thu, 6 Sep 2007 16:19:48 +0000 (16:19 +0000)] 
massive changes to add a 'zipper' representation of C--

Changes too numerous to comment on, but here is some old history that
I saved:

Wed Aug 15 11:07:13 BST 2007  Norman Ramsey <>
  * type synonyms made consistent with new Cmm types

    M ./compiler/nativeGen/MachInstrs.hs -2 +2

Mon Aug 20 19:22:14 BST 2007  Norman Ramsey <>
  * pushing return info beyond cmm into codegen

    M ./compiler/codeGen/Bitmap.hs r3
    M ./compiler/codeGen/CgBindery.lhs r3
    M ./compiler/codeGen/CgCallConv.hs r3
    M ./compiler/codeGen/CgCase.lhs r3
    M ./compiler/codeGen/CgClosure.lhs r3
    M ./compiler/codeGen/CgCon.lhs r3
    M ./compiler/codeGen/CgExpr.lhs r3
    M ./compiler/codeGen/CgForeignCall.hs -6 +7 r3
    M ./compiler/codeGen/CgHeapery.lhs r3
    M ./compiler/codeGen/CgHpc.hs +1 r3
    M ./compiler/codeGen/CgInfoTbls.hs r3
    M ./compiler/codeGen/CgLetNoEscape.lhs r3
    M ./compiler/codeGen/CgMonad.lhs r3
    M ./compiler/codeGen/CgParallel.hs r3
    M ./compiler/codeGen/CgPrimOp.hs +3 r3
    M ./compiler/codeGen/CgProf.hs r3
    M ./compiler/codeGen/CgStackery.lhs r3
    M ./compiler/codeGen/CgTailCall.lhs r3
    M ./compiler/codeGen/CgTicky.hs r3
    M ./compiler/codeGen/CgUtils.hs -1 +1 r3
    M ./compiler/codeGen/ClosureInfo.lhs r3
    M ./compiler/codeGen/CodeGen.lhs r3
    M ./compiler/codeGen/SMRep.lhs r3
    M ./compiler/nativeGen/AsmCodeGen.lhs -2 +2 r1
    M ./compiler/nativeGen/MachCodeGen.hs -3 +3 r1
    M ./compiler/nativeGen/MachInstrs.hs r1
    M ./compiler/nativeGen/MachRegs.lhs r1
    M ./compiler/nativeGen/NCGMonad.hs r1
    M ./compiler/nativeGen/PositionIndependentCode.hs r1
    M ./compiler/nativeGen/PprMach.hs r1
    M ./compiler/nativeGen/RegAllocInfo.hs r1
    M ./compiler/nativeGen/RegisterAlloc.hs r1

Mon Aug 20 20:54:41 BST 2007  Norman Ramsey <>
  * put CmmReturnInfo into a CmmCall (and related types)

    M ./compiler/cmm/Cmm.hs -2 +1 r3
    M ./compiler/cmm/CmmBrokenBlock.hs -13 +12 r1
    M ./compiler/cmm/CmmCPS.hs -3 +3
    M ./compiler/cmm/CmmCPSGen.hs -8 +6 r1
    M ./compiler/cmm/CmmLint.hs -1 +1
    M ./compiler/cmm/CmmLive.hs -1 +1
    M ./compiler/cmm/CmmOpt.hs -3 +3
    M ./compiler/cmm/CmmParse.y -6 +6 r3
    M ./compiler/cmm/PprC.hs -3 +3
    M ./compiler/cmm/PprCmm.hs -7 +4 r2
    M ./compiler/codeGen/CgForeignCall.hs -7 +6 r2
    M ./compiler/codeGen/CgHpc.hs -1 r1
    M ./compiler/codeGen/CgPrimOp.hs -3 r1
    M ./compiler/codeGen/CgUtils.hs -1 +1 r1
    M ./compiler/nativeGen/AsmCodeGen.lhs -2 +2
    M ./compiler/nativeGen/MachCodeGen.hs -3 +3 r1

Tue Aug 21 18:09:13 BST 2007  Norman Ramsey <>
  * add call info in nativeGen

    M ./compiler/nativeGen/AsmCodeGen.lhs r1
    M ./compiler/nativeGen/MachInstrs.hs r1
    M ./compiler/nativeGen/MachRegs.lhs r1
    M ./compiler/nativeGen/NCGMonad.hs r1
    M ./compiler/nativeGen/PositionIndependentCode.hs r1
    M ./compiler/nativeGen/PprMach.hs r1
    M ./compiler/nativeGen/RegAllocInfo.hs r1

Wed Aug 22 16:41:58 BST 2007  Norman Ramsey <>
  * ListGraph is now a newtype, not a synonym
  The resultant bookkeepping is unenviable, but the change
  greatly simplifies our ability to make Cmm things propertly
  Outputable for both list-graph and zipper-graph representations.

    M ./compiler/cmm/Cmm.hs -5 +3
    M ./compiler/cmm/CmmCPS.hs -2 +2
    M ./compiler/cmm/CmmCPSGen.hs -1 +1
    M ./compiler/cmm/CmmContFlowOpt.hs -3 +3
    M ./compiler/cmm/CmmCvt.hs -2 +2
    M ./compiler/cmm/CmmInfo.hs -2 +3
    M ./compiler/cmm/CmmLint.hs -1 +1
    M ./compiler/cmm/CmmOpt.hs -2 +2
    M ./compiler/cmm/PprC.hs -1 +1
    M ./compiler/cmm/PprCmm.hs -5 +8
    M ./compiler/cmm/PprCmmZ.hs -7 +1
    M ./compiler/codeGen/CgMonad.lhs -1 +1
    M ./compiler/nativeGen/AsmCodeGen.lhs -15 +15
    M ./compiler/nativeGen/MachCodeGen.hs -2 +2
    M ./compiler/nativeGen/PositionIndependentCode.hs -6 +6
    M ./compiler/nativeGen/PprMach.hs -3 +2
    M ./compiler/nativeGen/RegAllocColor.hs +1
    M ./compiler/nativeGen/RegAllocLinear.hs -4 +5
    M ./compiler/nativeGen/RegCoalesce.hs -6 +6
    M ./compiler/nativeGen/RegLiveness.hs -12 +12

Thu Aug 23 13:44:49 BST 2007  Norman Ramsey <>
  * diagnostic assistance in case fromJust fails

    M ./compiler/nativeGen/MachCodeGen.hs -2 +5

Thu Aug 23 14:07:28 BST 2007  Norman Ramsey <>
  * give every block, even the first, a label
    With branch-chain elimination, the first block of a procedure
    might be the target of a branch.  This actually happens to
    a dozen or more procedures in the run-time system.

    M ./compiler/nativeGen/PprMach.hs -8 +3

Fri Aug 24 17:27:04 BST 2007  Norman Ramsey <>
  * clean up the code in PprMach

    M ./compiler/nativeGen/PprMach.hs -16 +14

Fri Aug 24 19:35:03 BST 2007  Norman Ramsey <>
  * a bunch of impedance matching to get the compiler to build, plus
   * the plus is diagnostics for unreachable code, which required
     moving a lot of prettyprinting code

    M ./compiler/cmm/Cmm.hs -7 +5
    M ./compiler/cmm/CmmCPSZ.hs -1 +1
    M ./compiler/cmm/CmmCvt.hs -8 +8
    M ./compiler/cmm/CmmParse.y -4 +3
    M ./compiler/cmm/MkZipCfg.hs -19 +9
    M ./compiler/cmm/PprCmmZ.hs -118 +4
    M ./compiler/cmm/ZipCfg.hs -1 +13
    M ./compiler/cmm/ZipCfgCmm.hs -10 +129
    M ./compiler/main/HscMain.lhs -4 +4
    M ./compiler/nativeGen/NCGMonad.hs -2 +2
    M ./compiler/nativeGen/RegAllocInfo.hs -3 +3

Fri Aug 31 14:38:02 BST 2007  Norman Ramsey <>
  * fix a warning about an import

    M ./compiler/nativeGen/RegAllocColor.hs -1 +1

12 years agoMake installPackage install settings from the [package].buildinfo file. [Thu, 6 Sep 2007 01:00:44 +0000 (01:00 +0000)] 
Make installPackage install settings from the [package].buildinfo file.

M ./libraries/installPackage.hs -1 +14

12 years agoWibble some variable definitions to fix installation of bindists
Ian Lynagh [Thu, 6 Sep 2007 14:04:30 +0000 (14:04 +0000)] 
Wibble some variable definitions to fix installation of bindists

12 years agoRemove hardtop_plat/FPTOOLS_TOP_ABS_PLATFORM
Ian Lynagh [Thu, 6 Sep 2007 12:20:36 +0000 (12:20 +0000)] 
Remove hardtop_plat/FPTOOLS_TOP_ABS_PLATFORM
They are now the same as hardtop/FPTOOLS_TOP_ABS, so use those instead.

Also removed some substitutions of / for \, as we now use a Haskell
program to find the top path, and it only makes paths with /s in.

12 years agoCure space leak in coloring register allocator [Thu, 6 Sep 2007 13:15:22 +0000 (13:15 +0000)] 
Cure space leak in coloring register allocator

We now do a deep seq on the graph after it is 'built', but before coloring.
Without this, the colorer will just force bits of it and the heap will
fill up with half evaluated pieces of graph from previous build/spill
stages and zillions of apply thunks.

12 years agoSmall improvement to GraphColor.selectColor [Thu, 6 Sep 2007 10:33:47 +0000 (10:33 +0000)] 
Small improvement to GraphColor.selectColor

When selecting a color for a node, try and avoid using colors that
conflicting nodes prefer. Not sure if this'll make much difference,
but it was easy enough to add..

12 years agoSet GhcBootLibs=YES in mk/
Ian Lynagh [Thu, 6 Sep 2007 11:36:29 +0000 (11:36 +0000)] 
Set GhcBootLibs=YES in mk/

12 years agoQuote all the arguments to installPackage
Ian Lynagh [Wed, 5 Sep 2007 23:29:59 +0000 (23:29 +0000)] 
Quote all the arguments to installPackage
Makes it obvious what's going on if any are empty.

12 years agowarning police
Pepe Iborra [Thu, 6 Sep 2007 10:24:17 +0000 (10:24 +0000)] 
warning police

12 years agoCleanup of equality rewriting and no swapInsts for wanteds
Manuel M T Chakravarty [Thu, 6 Sep 2007 11:58:18 +0000 (11:58 +0000)] 
Cleanup of equality rewriting and no swapInsts for wanteds
- Removed code duplication
- Added comments
- Took out swapInsts for wanteds.  With the recent extension to swapInsts
  it does mess up error messages if applied to wanteds and i should not be
NB: The code actually shrunk.  Line increase is due to comments.

12 years agoRemove EqInsts from addSCs to avoid -DDEBUG warnings
Manuel M T Chakravarty [Thu, 6 Sep 2007 09:51:02 +0000 (09:51 +0000)] 
Remove EqInsts from addSCs to avoid -DDEBUG warnings

12 years agoEqInst related clean up
Manuel M T Chakravarty [Thu, 6 Sep 2007 09:50:18 +0000 (09:50 +0000)] 
EqInst related clean up
- Remove some unused and some superflous functions
- Add comments regarding ancestor equalities
- Tidied ancestor equality computation
- Replace some incorrect instToId by instToVar (but there are still some
  bad ones around as we still get warnings with -DDEBUG)
- Some cleaned up layout
NB: Code growth is just due to more comments.

12 years agoRemove dead code in TcSimplify
Manuel M T Chakravarty [Thu, 6 Sep 2007 03:17:19 +0000 (03:17 +0000)] 
Remove dead code in TcSimplify

12 years agoFix -DDEBUG warning
Manuel M T Chakravarty [Thu, 6 Sep 2007 02:39:14 +0000 (02:39 +0000)] 
Fix -DDEBUG warning

12 years agoalso swap for variables in completion algorithm
Tom Schrijvers [Wed, 5 Sep 2007 13:44:26 +0000 (13:44 +0000)] 
also swap for variables in completion algorithm

12 years agoFIX #1465, error messages could sometimes say things like "A.T doesn't match A.T"
Simon Marlow [Thu, 6 Sep 2007 09:37:44 +0000 (09:37 +0000)] 
FIX #1465, error messages could sometimes say things like "A.T doesn't match A.T"
This turned out to be a black hole, however we believe we now have a
plan that does the right thing and shouldn't need to change again.
Error messages will only ever refer to a name in an unambiguous way,
falling back to <package>:<module>.<name> if no unambiguous shorter
variant can be found.  See HscTypes.mkPrintUnqualified for the

Earlier hacks to work around this problem have been removed (TcSimplify).

12 years agofix error in .hi-boot-6
Simon Marlow [Wed, 5 Sep 2007 11:25:03 +0000 (11:25 +0000)] 
fix error in .hi-boot-6

12 years agoImprove GraphColor.colorScan [Wed, 5 Sep 2007 16:44:01 +0000 (16:44 +0000)] 
Improve GraphColor.colorScan

Testing whether a node in the conflict graph is trivially
colorable (triv) is still a somewhat expensive operation.

When we find a triv node during scanning, even though we remove
it and its edges from the graph, this is unlikely to to make the
nodes we've just scanned become triv - so there's not much point
re-scanning them right away.

Scanning now takes place in passes. We scan the whole graph for
triv nodes and remove all the ones found in a batch before rescanning
old nodes.

Register allocation for SHA1.lhs now takes (just) 40% of total
compile time with -O2 -fregs-graph on x86

12 years agoFix OS X warnings
Roman Leshchinskiy [Thu, 6 Sep 2007 00:48:31 +0000 (00:48 +0000)] 
Fix OS X warnings

12 years agoDeclare ctime_r on Mac OS
Roman Leshchinskiy [Thu, 6 Sep 2007 00:16:13 +0000 (00:16 +0000)] 
Declare ctime_r on Mac OS

On Mac OS, ctime_r is not declared in time.h if _POSIX_C_SOURCE is defined. We
work around this by providing a declaration ourselves.

12 years agoFIX #1651: use family instances during interactive typechecking
Manuel M T Chakravarty [Wed, 5 Sep 2007 13:02:44 +0000 (13:02 +0000)] 
FIX #1651: use family instances during interactive typechecking

12 years agoAdd an OPTIONS -w pragma to utils/genprimopcode/Lexer.xx
Ian Lynagh [Wed, 5 Sep 2007 18:48:08 +0000 (18:48 +0000)] 
Add an OPTIONS -w pragma to utils/genprimopcode/Lexer.xx
SPJ reports that it has warnings (=> errors with -Werror) on Windows.

12 years agoBuild settings for validation are now in mk/
Ian Lynagh [Wed, 5 Sep 2007 18:46:14 +0000 (18:46 +0000)] 
Build settings for validation are now in mk/

12 years agoDon't give warnings in compat
Ian Lynagh [Wed, 5 Sep 2007 18:29:23 +0000 (18:29 +0000)] 
Don't give warnings in compat
There are lots of warnings in here due to things like modules being
imported that, in some versions of GHC, aren't used. Thus we don't
give any warnings in here, and therefore validating with -Werror won't
make the build fail.

An alternative would be to do
SRC_HC_OPTS := $(filter-out -Werror,$(SRC_HC_OPTS))
but if warnings are expected then there is little point in spewing them
out anyway.

On the other hand, there aren't any warnings for me (GHC 6.6 on Linux/amd64),
so perhaps it would be worth fixing them instead.

12 years agoTypo
Ian Lynagh [Wed, 5 Sep 2007 16:14:02 +0000 (16:14 +0000)] 

12 years agoFix bindist creation on Windows
Ian Lynagh [Wed, 5 Sep 2007 16:13:54 +0000 (16:13 +0000)] 
Fix bindist creation on Windows

12 years agoFix up bindist creation and publishing
Ian Lynagh [Wed, 5 Sep 2007 16:06:41 +0000 (16:06 +0000)] 
Fix up bindist creation and publishing

12 years agoRefactor, improve, and document the deriving mechanism [Wed, 5 Sep 2007 17:07:30 +0000 (17:07 +0000)] 
Refactor, improve, and document the deriving mechanism

This patch does a fairly major clean-up of the code that implements 'deriving.

* The big changes are in TcDeriv, which is dramatically cleaned up.
  In particular, there is a clear split into
a) inference of instance contexts for deriving clauses
b) generation of the derived code, given a context
  Step (a) is skipped for standalone instance decls, which
  have an explicitly provided context.

* The handling of "taggery", which is cooperative between TcDeriv and
  TcGenDeriv, is cleaned up a lot

* I have added documentation for standalone deriving (which was
  previously wrong).

* The Haskell report is vague on exactly when a deriving clause should
  succeed.  Prodded by Conal I have loosened the rules slightly, thereyb
  making drv015 work again, and documented the rules in the user manual.

I believe this patch validates ok (once I've update the test suite)
and can go into the 6.8 branch.

12 years agoFurther documentation about mdo, suggested by Benjamin Franksen [Wed, 29 Aug 2007 08:33:49 +0000 (08:33 +0000)] 
Further documentation about mdo, suggested by Benjamin Franksen

12 years agoRefactor MachRegs.trivColorable to do unboxed accumulation [Wed, 5 Sep 2007 12:52:19 +0000 (12:52 +0000)] 
Refactor MachRegs.trivColorable to do unboxed accumulation

trivColorable was soaking up total 31% time, 41% alloc when
compiling SHA1.lhs with -O2 -fregs-graph on x86.

Refactoring to use unboxed accumulators and walk directly
over the UniqFM holding the set of conflicts reduces this
to 17% time, 6% alloc.

12 years agochange of representation for GenCmm, GenCmmTop, CmmProc
Norman Ramsey [Wed, 5 Sep 2007 16:48:02 +0000 (16:48 +0000)] 
change of representation for GenCmm, GenCmmTop, CmmProc
The type parameter to a C-- procedure now represents a control-flow
graph, not a single instruction.  The newtype ListGraph preserves the
current representation while enabling other representations and a
sensible way of prettyprinting.  Except for a few changes in the
prettyprinter the new compiler binary should be bit-for-bit identical
to the old.

12 years agoenable and slay warnings in cmm/Cmm.hs
Norman Ramsey [Wed, 5 Sep 2007 16:46:46 +0000 (16:46 +0000)] 
enable and slay warnings in cmm/Cmm.hs

12 years agofix warnings
Simon Marlow [Wed, 5 Sep 2007 11:42:05 +0000 (11:42 +0000)] 
fix warnings

12 years agoFIX #1650: ".boot modules interact badly with the ghci debugger"
Simon Marlow [Wed, 5 Sep 2007 10:47:16 +0000 (10:47 +0000)] 
FIX #1650: ".boot modules interact badly with the ghci debugger"

In fact hs-boot files had nothing to do with it: the problem was that
GHCi would forget the breakpoint information for a module that had
been reloaded but not recompiled.  It's amazing that we never noticed
this before.

The ModBreaks were in the ModDetails, which was the wrong place.  When
we avoid recompiling a module, ModDetails is regenerated from ModIface
by typecheckIface, and at that point it has no idea what the ModBreaks
should be, so typecheckIface made it empty.  The right place for the
ModBreaks to go is with the Linkable, which is retained when
compilation is avoided.  So now I've placed the ModBreaks in with the
CompiledByteCode, which also makes it clear that only byte-code
modules have breakpoints.

This fixes break022/break023