ghc-hetmet.git
16 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

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

16 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.

16 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.

16 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.
Highlights:

  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'.

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

16 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.

16 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

16 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

16 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.

16 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

16 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.

16 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.

16 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

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

16 years agoWarning police
simonpj@microsoft.com [Fri, 7 Sep 2007 10:11:03 +0000 (10:11 +0000)]
Warning police

16 years agoAdd clarifying comments
simonpj@microsoft.com [Fri, 7 Sep 2007 10:10:46 +0000 (10:10 +0000)]
Add clarifying comments

16 years agoFix zonking in mkExports
simonpj@microsoft.com [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)

  main/GHC.hs:1070:0:
     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

16 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

16 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

16 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.

16 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 <nr@eecs.harvard.edu>
  * 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 <nr@eecs.harvard.edu>
  * 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 <nr@eecs.harvard.edu>
  * 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 <nr@eecs.harvard.edu>
  * 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 <nr@eecs.harvard.edu>
  * 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 <nr@eecs.harvard.edu>
  * diagnostic assistance in case fromJust fails

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

Thu Aug 23 14:07:28 BST 2007  Norman Ramsey <nr@eecs.harvard.edu>
  * 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 <nr@eecs.harvard.edu>
  * clean up the code in PprMach

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

Fri Aug 24 19:35:03 BST 2007  Norman Ramsey <nr@eecs.harvard.edu>
  * 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 <nr@eecs.harvard.edu>
  * fix a warning about an import

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

16 years agoMake installPackage install settings from the [package].buildinfo file.
judah.jacobson@gmail.com [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

16 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

16 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.

16 years agoCure space leak in coloring register allocator
Ben.Lippmeier@anu.edu.au [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.

16 years agoSmall improvement to GraphColor.selectColor
Ben.Lippmeier@anu.edu.au [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..

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

16 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.

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

16 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
  necessary.
NB: The code actually shrunk.  Line increase is due to comments.

16 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

16 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.

16 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

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

16 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

16 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
details.

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

16 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

16 years agoImprove GraphColor.colorScan
Ben.Lippmeier@anu.edu.au [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

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

16 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.

16 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

16 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.

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

16 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.

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

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

16 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

16 years agoRefactor, improve, and document the deriving mechanism
simonpj@microsoft.com [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.

16 years agoFurther documentation about mdo, suggested by Benjamin Franksen
simonpj@microsoft.com [Wed, 29 Aug 2007 08:33:49 +0000 (08:33 +0000)]
Further documentation about mdo, suggested by Benjamin Franksen

16 years agoRefactor MachRegs.trivColorable to do unboxed accumulation
Ben.Lippmeier@anu.edu.au [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.

16 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.

16 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

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

16 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

16 years agoFix boot: it was avoiding autoreconfing
Simon Marlow [Wed, 5 Sep 2007 10:14:19 +0000 (10:14 +0000)]
Fix boot: it was avoiding autoreconfing
Two problems here: find needs to dereference symbolic links (-L
option, I really hope that's portable), and we need to notice when
aclocal.m4 is updated.

Somehow I think this was easier when it just always ran
autoreconf... what was wrong with that?

16 years agodon't generate .hi-boot/.o-boot files in GHCi
Simon Marlow [Tue, 4 Sep 2007 14:12:31 +0000 (14:12 +0000)]
don't generate .hi-boot/.o-boot files in GHCi

16 years agorefactoring only
Simon Marlow [Tue, 4 Sep 2007 14:12:09 +0000 (14:12 +0000)]
refactoring only

16 years agocompletion for modules in 'import M'
Simon Marlow [Tue, 4 Sep 2007 10:44:58 +0000 (10:44 +0000)]
completion for modules in 'import M'

16 years agomake the GhcThreaded setting lazy, because GhcUnregisterised might not be set yet
Simon Marlow [Tue, 4 Sep 2007 10:17:29 +0000 (10:17 +0000)]
make the GhcThreaded setting lazy, because GhcUnregisterised might not be set yet

16 years ago{Enter,Leave}CriticalSection imports should be outside #ifdef __PIC__
Simon Marlow [Wed, 5 Sep 2007 08:49:41 +0000 (08:49 +0000)]
{Enter,Leave}CriticalSection imports should be outside #ifdef __PIC__

16 years agowarning police
Ben.Lippmeier@anu.edu.au [Wed, 5 Sep 2007 09:45:09 +0000 (09:45 +0000)]
warning police

16 years agoDo conservative coalescing in register allocator
Ben.Lippmeier@anu.edu.au [Mon, 3 Sep 2007 16:34:04 +0000 (16:34 +0000)]
Do conservative coalescing in register allocator

Avoid coalescing nodes in the register conflict graph if the
new node will not be trivially colorable. Also remove the
front end aggressive coalescing pass.

For typical Haskell code the graph coloring allocator now does
about as well as the linear allocator.

For code with a large amount of register pressure it does much
better, but takes longer.

For SHA1.lhs from darcs on x86

          spills    reloads    reg-reg-moves
          inserted   inserted  left in code   compile-time
  linear    1068      1311        229            7.69(s)
  graph      387       902        340           16.12(s)

16 years agoUse dlsym on OS X if available
Roman Leshchinskiy [Wed, 5 Sep 2007 05:22:13 +0000 (05:22 +0000)]
Use dlsym on OS X if available

On OS X 10.4 and newer, we have to use dlsym because the old NS* interface has
been deprecated. The patch checks for HAVE_DLFCN_H instead of switching on
the OS version.

There is one additional quirk: although OS X prefixes global symbols with an
underscore, dlsym expects its argument NOT to have a leading underscore. As a
hack, we simply strip it off in lookupSymbol. Something a bit more elaborate
might be cleaner.

16 years agobug fix in Decomp step of completion algorithm for given equations
Tom Schrijvers [Tue, 4 Sep 2007 12:39:45 +0000 (12:39 +0000)]
bug fix in Decomp step of completion algorithm for given equations

16 years agofix of wanted equational class context
Tom Schrijvers [Tue, 4 Sep 2007 08:00:14 +0000 (08:00 +0000)]
fix of wanted equational class context

Previously failed to account for equational
class context for wanted dictionary contraints, e.g. wanted C a
in

class a ~ Int => C a
instance C Int

should give rise to wanted a ~ Int and consequently discharge a ~ Int by
unifying a with Int and then discharge C Int with the instance.

All ancestor equalities are taken into account.

16 years agoSet datarootdir to the value configure gives us (if any) so datadir works
Ian Lynagh [Wed, 5 Sep 2007 01:32:39 +0000 (01:32 +0000)]
Set datarootdir to the value configure gives us (if any) so datadir works
We then set datarootdir to something else later on so that things still
work when configure doesn't set it.

16 years agoFIX: Correct Leave/EnterCriticalSection imports
Manuel M T Chakravarty [Wed, 5 Sep 2007 01:02:17 +0000 (01:02 +0000)]
FIX: Correct Leave/EnterCriticalSection imports

16 years agoDon't hardwire the build path into the Haddock docs
sven.panne@aedion.de [Tue, 4 Sep 2007 17:28:55 +0000 (17:28 +0000)]
Don't hardwire the build path into the Haddock docs
Formerly, the ghc-pkg was called to get the HTML dirs for other packages, but
of course doing this at *build* time is totally wrong. Now we use a relative
path, just like before. This is probably not perfect, but much better than
before.

As a sidenote: Cabal calls the relevant flag "html-location", ghc-pkg calls the
field "haddock-html", and Haddock itself uses it as part of "read-interface".
Too much creativity is sometimes a bad thing...

16 years agoput the @N suffix on stdcall foreign calls in .cmm code
Simon Marlow [Tue, 4 Sep 2007 14:28:53 +0000 (14:28 +0000)]
put the @N suffix on stdcall foreign calls in .cmm code
This applies to EnterCriticalSection and LeaveCriticalSection in the RTS

16 years agoAdd a -Warn flag
Ian Lynagh [Tue, 4 Sep 2007 14:10:28 +0000 (14:10 +0000)]
Add a -Warn flag

16 years agoAlways turn on -Wall -Werror when compiling the compiler, even for stage 1
Ian Lynagh [Tue, 4 Sep 2007 14:03:24 +0000 (14:03 +0000)]
Always turn on -Wall -Werror when compiling the compiler, even for stage 1

16 years agoFix CodingStyle#Warnings URLs
Ian Lynagh [Tue, 4 Sep 2007 14:01:15 +0000 (14:01 +0000)]
Fix CodingStyle#Warnings URLs

16 years agoOPTIONS_GHC overrides the command-line, not the other way around
Simon Marlow [Tue, 4 Sep 2007 10:06:23 +0000 (10:06 +0000)]
OPTIONS_GHC overrides the command-line, not the other way around

16 years agofix cut-and-pasto
Simon Marlow [Tue, 4 Sep 2007 10:05:26 +0000 (10:05 +0000)]
fix cut-and-pasto

16 years agoFIX #1651: unBox types when deferring unification
Manuel M T Chakravarty [Tue, 4 Sep 2007 07:25:42 +0000 (07:25 +0000)]
FIX #1651: unBox types when deferring unification
- This fixes the first part of #1651; ie, the panic in ghci.

16 years agoBetter error message for unsolvable equalities
Manuel M T Chakravarty [Mon, 3 Sep 2007 07:45:28 +0000 (07:45 +0000)]
Better error message for unsolvable equalities

16 years agoUse := rather than = when assigning make variables to avoid cycles
Ian Lynagh [Mon, 3 Sep 2007 23:51:17 +0000 (23:51 +0000)]
Use := rather than = when assigning make variables to avoid cycles

16 years agoDon't use autoconf's datarootdir as <2.60 doesn't have it
Ian Lynagh [Mon, 3 Sep 2007 23:45:04 +0000 (23:45 +0000)]
Don't use autoconf's datarootdir as <2.60 doesn't have it

16 years agoUse OPTIONS rather than OPTIONS_GHC for pragmas
Ian Lynagh [Mon, 3 Sep 2007 23:39:03 +0000 (23:39 +0000)]
Use OPTIONS rather than OPTIONS_GHC for pragmas
Older GHCs can't parse OPTIONS_GHC.
This also changes the URL referenced for the -w options from
WorkingConventions#Warnings to CodingStyle#Warnings for the compiler
modules.

16 years agoFix building RTS with gcc 2.*; declare all variables at the top of a block
Ian Lynagh [Mon, 3 Sep 2007 16:58:47 +0000 (16:58 +0000)]
Fix building RTS with gcc 2.*; declare all variables at the top of a block
Patch from Audrey Tang.

16 years agofix build (sorry, forgot to push with previous patch)
Simon Marlow [Mon, 3 Sep 2007 20:06:15 +0000 (20:06 +0000)]
fix build (sorry, forgot to push with previous patch)

16 years agoremove debugging code
Simon Marlow [Mon, 3 Sep 2007 20:00:03 +0000 (20:00 +0000)]
remove debugging code

16 years agoNCG space leak avoidance refactor
Ben.Lippmeier@anu.edu.au [Mon, 3 Sep 2007 13:22:54 +0000 (13:22 +0000)]
NCG space leak avoidance refactor

16 years agoDo aggressive register coalescing
Ben.Lippmeier@anu.edu.au [Mon, 3 Sep 2007 11:51:49 +0000 (11:51 +0000)]
Do aggressive register coalescing
Conservative and iterative coalescing come next.

16 years agoAdd coalescence edges back to the register graph
Ben.Lippmeier@anu.edu.au [Tue, 28 Aug 2007 14:44:24 +0000 (14:44 +0000)]
Add coalescence edges back to the register graph

16 years agoFIX #1623: disable the timer signal when the system is idle (threaded RTS only)
Simon Marlow [Mon, 3 Sep 2007 13:25:23 +0000 (13:25 +0000)]
FIX #1623: disable the timer signal when the system is idle (threaded RTS only)
Having a timer signal go off regularly is bad for power consumption,
and generally bad practice anyway (it means the app cannot be
completely swapped out, for example).  Fortunately the threaded RTS
already had a way to detect when the system was idle, so that it can
trigger a GC and thereby find deadlocks.  After performing the GC, we
now turn off timer signals, and re-enable them again just before
running any Haskell code.

16 years agoFIX #1648: rts_mkWord64 was missing
Simon Marlow [Mon, 3 Sep 2007 13:16:25 +0000 (13:16 +0000)]
FIX #1648: rts_mkWord64 was missing
Also noticed a few others from RtsAPI were missing, so I added them all

16 years agoFIX for #1080
Ross Paterson [Mon, 3 Sep 2007 14:10:44 +0000 (14:10 +0000)]
FIX for #1080

Arrow desugaring now uses a private version of collectPatBinders and
friends, in order to include dictionary bindings from ConPatOut.

It doesn't fix arrowrun004 (#1333), though.

16 years agoFix space leak in NCG
Ben.Lippmeier@anu.edu.au [Fri, 31 Aug 2007 09:04:31 +0000 (09:04 +0000)]
Fix space leak in NCG

16 years agoGhcThreaded was bogusly off by default due to things being in the wrong order
Simon Marlow [Mon, 3 Sep 2007 10:38:29 +0000 (10:38 +0000)]
GhcThreaded was bogusly off by default due to things being in the wrong order

16 years agobump MAX_THUNK_SELECTOR_DEPTH from 8 to 16
Simon Marlow [Mon, 3 Sep 2007 10:19:12 +0000 (10:19 +0000)]
bump MAX_THUNK_SELECTOR_DEPTH from 8 to 16
this "fixes" #1038, in that the example runs in constant space, but
it's really only working around the problem.  I have a better patch,
attached to ticket #1038, but I'm wary about tinkering with this
notorious bug farm so close to the release, so I'll push it after
6.8.1.

16 years agocomments only
Simon Marlow [Fri, 31 Aug 2007 09:22:24 +0000 (09:22 +0000)]
comments only
I had planned to do findEnclosingDecl a different way, so add a ToDo
as a reminder.

16 years agoSuppress some warnings on Windows
Ian Lynagh [Sun, 2 Sep 2007 22:20:48 +0000 (22:20 +0000)]
Suppress some warnings on Windows

16 years agoFix warnings in ghc-pkg on Windows
Ian Lynagh [Sun, 2 Sep 2007 22:14:42 +0000 (22:14 +0000)]
Fix warnings in ghc-pkg on Windows

16 years agoFix and supress some warnings, and turn on -Werror when validating
Ian Lynagh [Sun, 2 Sep 2007 19:39:18 +0000 (19:39 +0000)]
Fix and supress some warnings, and turn on -Werror when validating

16 years agoExplicitly set "docdir" when calling make, configure's --docdir seems to be ignored
sven.panne@aedion.de [Sun, 2 Sep 2007 16:43:42 +0000 (16:43 +0000)]
Explicitly set "docdir" when calling make, configure's --docdir seems to be ignored

16 years agoUse DESTDIR for installation
sven.panne@aedion.de [Sat, 1 Sep 2007 17:51:24 +0000 (17:51 +0000)]
Use DESTDIR for installation

16 years agoFixed TeX syntax
sven.panne@aedion.de [Sat, 1 Sep 2007 12:46:15 +0000 (12:46 +0000)]
Fixed TeX syntax

16 years agoSet -Wall -fno-warn-name-shadowing in compiler/ when stage /= 2
Ian Lynagh [Sat, 1 Sep 2007 11:30:18 +0000 (11:30 +0000)]
Set -Wall -fno-warn-name-shadowing in compiler/ when stage /= 2