ghc.git
9 years agoRename a variable
Ian Lynagh [Sat, 13 Mar 2010 22:48:52 +0000 (22:48 +0000)] 
Rename a variable

9 years agoAdd a link-time flag to en/disable the RTS options
Ian Lynagh [Sat, 13 Mar 2010 15:45:55 +0000 (15:45 +0000)] 
Add a link-time flag to en/disable the RTS options
If RTS options are disabled then:
* The ghc_rts_opts C code variable is processed as normal
* The GHCRTS environment variable is ignored and, if it is defined, a
  warning is emitted
* The +RTS flag gives an error and terminates the program

9 years agoFix a couple of bugs in the throwTo handling, exposed by conc016(threaded2)
Simon Marlow [Thu, 11 Mar 2010 12:37:05 +0000 (12:37 +0000)] 
Fix a couple of bugs in the throwTo handling, exposed by conc016(threaded2)

9 years agoUse message-passing to implement throwTo in the RTS
Simon Marlow [Thu, 11 Mar 2010 09:57:44 +0000 (09:57 +0000)] 
Use message-passing to implement throwTo in the RTS

This replaces some complicated locking schemes with message-passing
in the implementation of throwTo. The benefits are

 - previously it was impossible to guarantee that a throwTo from
   a thread running on one CPU to a thread running on another CPU
   would be noticed, and we had to rely on the GC to pick up these
   forgotten exceptions. This no longer happens.

 - the locking regime is simpler (though the code is about the same
   size)

 - threads can be unblocked from a blocked_exceptions queue without
   having to traverse the whole queue now.  It's a rare case, but
   replaces an O(n) operation with an O(1).

 - generally we move in the direction of sharing less between
   Capabilities (aka HECs), which will become important with other
   changes we have planned.

Also in this patch I replaced several STM-specific closure types with
a generic MUT_PRIM closure type, which allowed a lot of code in the GC
and other places to go away, hence the line-count reduction.  The
message-passing changes resulted in about a net zero line-count
difference.

9 years agofix bug in discardTasksExcept() that broke forkProcess
Simon Marlow [Thu, 11 Mar 2010 09:36:32 +0000 (09:36 +0000)] 
fix bug in discardTasksExcept() that broke forkProcess

10 years agodisable a false assertion, add a comment to explain why
Simon Marlow [Mon, 23 Nov 2009 11:04:16 +0000 (11:04 +0000)] 
disable a false assertion, add a comment to explain why

9 years agoFix Trac #1954: newtype deriving caused 'defined but not used' error
simonpj@microsoft.com [Tue, 9 Mar 2010 17:35:55 +0000 (17:35 +0000)] 
Fix Trac #1954: newtype deriving caused 'defined but not used' error

We were getting a bogus claim that a newtype "data constructor" was
unused.  The fix is easy, although I had to add a field to the constructor
TcEnv.NewTypeDerived

See Note [Newtype deriving and unused constructors] in TcDeriv

9 years agoRule binders shouldn't have IdInfo
simonpj@microsoft.com [Tue, 9 Mar 2010 17:33:27 +0000 (17:33 +0000)] 
Rule binders shouldn't have IdInfo

While I was looking at the rule binders generated in DsBinds for specialise pragmas,
I also looked at Specialise.  It too was "cloning" the dictionary binders including
their IdInfo. In this case they should not have any, but its seems better to make
them completely fresh rather than substitute in existing (albeit non-existent) IdInfo.

9 years agoAdd comment
simonpj@microsoft.com [Tue, 9 Mar 2010 17:31:20 +0000 (17:31 +0000)] 
Add comment

9 years agoRule binders shouldn't have DFun pragmas
simonpj@microsoft.com [Tue, 9 Mar 2010 17:31:00 +0000 (17:31 +0000)] 
Rule binders shouldn't have DFun pragmas

When DsBinds deals with a SPECIALISE pragma, it makes up the binders
for a RULE. These binders should be very vanilla: no IdInfo of any sort.
But the way it was before they could have DFun pragmas, which led to
Bad Joss downstream.  (Actually to cause a downstream *error* was itself
a bug, which I've fixed, but it's clearly wrong for them to be DFuns!)

9 years agoA bug in isClosedUnfolding
simonpj@microsoft.com [Tue, 9 Mar 2010 17:28:42 +0000 (17:28 +0000)] 
A bug in isClosedUnfolding

isClosedUnfolding should say False for DFUnUnfolding!

9 years agoComments only
simonpj@microsoft.com [Tue, 9 Mar 2010 17:28:14 +0000 (17:28 +0000)] 
Comments only

9 years agoComments and type signatures only
simonpj@microsoft.com [Tue, 9 Mar 2010 17:27:56 +0000 (17:27 +0000)] 
Comments and type signatures only

9 years agoComments only
simonpj@microsoft.com [Tue, 9 Mar 2010 17:27:43 +0000 (17:27 +0000)] 
Comments only

9 years agoTidy up pretty-printing of InlinePragma
simonpj@microsoft.com [Tue, 9 Mar 2010 17:27:30 +0000 (17:27 +0000)] 
Tidy up pretty-printing of InlinePragma

We were getting "INLINEALWAYS" printed out here and there.
Now there are always brackets around the activation, thus "INLINE[ALWAYS]"

9 years agoSplit part of the Task struct into a separate struct InCall
Simon Marlow [Tue, 9 Mar 2010 14:31:11 +0000 (14:31 +0000)] 
Split part of the Task struct into a separate struct InCall

The idea is that this leaves Tasks and OSThread in one-to-one
correspondence.  The part of a Task that represents a call into
Haskell from C is split into a separate struct InCall, pointed to by
the Task and the TSO bound to it.  A given OSThread/Task thus always
uses the same mutex and condition variable, rather than getting a new
one for each callback.  Conceptually it is simpler, although there are
more types and indirections in a few places now.

This improves callback performance by removing some of the locks that
we had to take when making in-calls.  Now we also keep the current Task
in a thread-local variable if supported by the OS and gcc (currently
only Linux).

9 years agoadd a note
Simon Marlow [Tue, 9 Mar 2010 13:37:21 +0000 (13:37 +0000)] 
add a note

9 years agoFix a rare deadlock when the IO manager thread is slow to start up
Simon Marlow [Tue, 9 Mar 2010 09:58:31 +0000 (09:58 +0000)] 
Fix a rare deadlock when the IO manager thread is slow to start up
This fixes occasional failures of ffi002(threaded1) on a loaded
machine.

9 years agoWhen BUILD_DOCBOOK_HTML is NO, keep the rules, just omit the target
simonpj@microsoft.com [Fri, 5 Mar 2010 17:30:04 +0000 (17:30 +0000)] 
When BUILD_DOCBOOK_HTML is NO, keep the rules, just omit the target

  (and similarly for PS and PDF)

The previous setup nuked the rules for making the documentation when
BUILD_DOCBOOK_HTML=NO.  This meant that "make html" didn't work.

There isn't any reason to nuke the rules (so far as Simon and I know).

9 years agoFix Trac #3736: do not preInlineUnconditionally with INLINE
simonpj@microsoft.com [Fri, 5 Mar 2010 17:27:59 +0000 (17:27 +0000)] 
Fix Trac #3736: do not preInlineUnconditionally with INLINE

preInlineUnconditionally was, in effect, nuking an INLINE pragma, with
very bad effect on runtime in this program.  Fortunately the fix is
very simple.

See Note [InlineRule and preInlineUnconditionally] in SimplUtils.

9 years agoComments only
simonpj@microsoft.com [Thu, 4 Mar 2010 12:59:30 +0000 (12:59 +0000)] 
Comments only

9 years agoComments only
simonpj@microsoft.com [Thu, 4 Mar 2010 12:54:02 +0000 (12:54 +0000)] 
Comments only

9 years agoRefactor part of the renamer to fix Trac #3901
simonpj@microsoft.com [Thu, 4 Mar 2010 12:53:37 +0000 (12:53 +0000)] 
Refactor part of the renamer to fix Trac #3901

This one was bigger than I anticipated!  The problem was that were
were gathering the binders from a pattern before renaming -- but with
record wild-cards we don't know what variables are bound by C {..}
until after the renamer has filled in the "..".

So this patch does the following

* Change all the collect-X-Binders functions in HsUtils so that
  they expect to only be called *after* renaming.  That means they
  don't need to return [Located id] but just [id].  Which turned out
  to be a very worthwhile simplification all by itself.

* Refactor the renamer, and in ptic RnExpr.rnStmt, so that it
  doesn't need to use collectLStmtsBinders on pre-renamed Stmts.

* This in turn required me to understand how GroupStmt and
  TransformStmts were renamed.  Quite fiddly. I rewrote most of it;
  result is much shorter.

* In doing so I flattened HsExpr.GroupByClause into its parent
  GroupStmt, with trivial knock-on effects in other files.

Blargh.

9 years agoMinor refactoring of placeHolderPunRhs
simonpj@microsoft.com [Thu, 4 Mar 2010 12:41:13 +0000 (12:41 +0000)] 
Minor refactoring of placeHolderPunRhs

9 years agoMake `mkFunTy` associate to the right, as it should
simonpj@microsoft.com [Thu, 4 Mar 2010 12:40:29 +0000 (12:40 +0000)] 
Make `mkFunTy` associate to the right, as it should

9 years agoAdd fmapMaybeM and fmapEitherM
simonpj@microsoft.com [Thu, 4 Mar 2010 12:40:04 +0000 (12:40 +0000)] 
Add fmapMaybeM and fmapEitherM

9 years agoComments only
simonpj@microsoft.com [Thu, 4 Mar 2010 12:39:39 +0000 (12:39 +0000)] 
Comments only

9 years agoTwo things to do with -dsuppress-uniques
simonpj@microsoft.com [Thu, 4 Mar 2010 12:38:22 +0000 (12:38 +0000)] 
Two things to do with -dsuppress-uniques

a) Even with -dsuppress-uniques, don't suppress them when outputing
   code, else the assembler falls over bleating

b) Do suppress uniques in names generated by TH.  It's a bit grungy
   to do this: see Note [Suppressing uniques in OccNames].  But
   it's only needed for test de-wobblification so the grunge isn't
   really important.

9 years agofix the Windows build some more
Simon Marlow [Thu, 4 Mar 2010 09:21:19 +0000 (09:21 +0000)] 
fix the Windows build some more

9 years agoAdd comments to darcs-all and packages
simonpj@microsoft.com [Wed, 3 Mar 2010 21:59:48 +0000 (21:59 +0000)] 
Add comments to darcs-all and packages

9 years agoAdd the implicit 'import Prelude' in getImports
Simon Marlow [Wed, 3 Mar 2010 11:22:42 +0000 (11:22 +0000)] 
Add the implicit 'import Prelude' in getImports
This makes things more consistent, and avoids a strange "Prelude is
not loaded" error when there is a Prelude.hs on the search path.

9 years agofix Windows build
Simon Marlow [Tue, 2 Mar 2010 14:47:19 +0000 (14:47 +0000)] 
fix Windows build

9 years agosdist: Haddock.Interface.{Lex,Parse} moved to Haddock.{Lex,Parse}
Simon Marlow [Tue, 2 Mar 2010 09:43:38 +0000 (09:43 +0000)] 
sdist: Haddock.Interface.{Lex,Parse} moved to Haddock.{Lex,Parse}

9 years agoAdd handling for | to the transitional alternative layout rule
Ian Lynagh [Tue, 2 Mar 2010 20:58:15 +0000 (20:58 +0000)] 
Add handling for | to the transitional alternative layout rule

9 years agoTweak alternative layout rule
Ian Lynagh [Tue, 2 Mar 2010 20:51:05 +0000 (20:51 +0000)] 
Tweak alternative layout rule
Now not only is if/then a bracketting pair, but then/else is too

9 years agoAdd transitional rules for the alternative layout rule
Ian Lynagh [Tue, 2 Mar 2010 20:20:35 +0000 (20:20 +0000)] 
Add transitional rules for the alternative layout rule
If enabled, these accept more layout, but give warnings

9 years agoFix the alternative layout rule to handle explicit let/in
Ian Lynagh [Tue, 2 Mar 2010 16:51:19 +0000 (16:51 +0000)] 
Fix the alternative layout rule to handle explicit let/in
It used to break on
    let {x = 'a'} in x
as the 'in' token would keep closing contexts looking for an implicit
'let' layout.

9 years agoexpand comments for #2578 fix
Simon Marlow [Mon, 1 Mar 2010 09:55:25 +0000 (09:55 +0000)] 
expand comments for #2578 fix

9 years agoa faster appendFS
ich@christoph-bauer.net [Sat, 27 Feb 2010 21:16:59 +0000 (21:16 +0000)] 
a faster appendFS

9 years agoImplement a smart constructor mkUnsafeCoercion, and use it
simonpj@microsoft.com [Mon, 1 Mar 2010 11:17:44 +0000 (11:17 +0000)] 
Implement a smart constructor mkUnsafeCoercion, and use it

This just ensures that an unsafe coercion is as localised as possible.
For example, instead of
    UnsafeCo (Int -> t1) (Int -> t2)
use
    Int -> UnsafeCo t1 t2

9 years agoSuggest -XGeneralizedNewtypeDeriving (fix Trac #3888)
simonpj@microsoft.com [Mon, 1 Mar 2010 11:15:55 +0000 (11:15 +0000)] 
Suggest -XGeneralizedNewtypeDeriving (fix Trac #3888)

If we can't derive a type, but it's a reasonable possibility that
newtype deriving would do the job, suggest it.

A little refactoring too, moving non_iso_class to top level,
and putting it with std_class_via_iso.

9 years agoTidy up AnyTyCon stuff
simonpj@microsoft.com [Mon, 1 Mar 2010 11:14:01 +0000 (11:14 +0000)] 
Tidy up AnyTyCon stuff

If we find ourselves making up an AnyTyCon of kind '??', say,
then default it to liftedTypeKind.  And similarly for any sub-kind
of LiftedTypeKind.

This is just a tidy-up.

9 years agoFix pretty-printing of IfaceAnyTc (fixes Trac #3883)
simonpj@microsoft.com [Mon, 1 Mar 2010 11:10:40 +0000 (11:10 +0000)] 
Fix pretty-printing of IfaceAnyTc (fixes Trac #3883)

The panic message in ifaceTyConName on IfaceAnyTc
called the pretty-printer, called ifaceTyConName again,
which caused an infinite regress.  Stupid.

See
 * Note [The Name of an IfaceAnyTc], and
 * The Outputable instance for IfaceTyCon

9 years agoOmit unnecessary parens when pretty-printing IfaceExpr
simonpj@microsoft.com [Mon, 1 Mar 2010 11:07:48 +0000 (11:07 +0000)] 
Omit unnecessary parens when pretty-printing IfaceExpr

9 years agoComments only
simonpj@microsoft.com [Thu, 25 Feb 2010 17:41:12 +0000 (17:41 +0000)] 
Comments only

9 years agoAdd comment
simonpj@microsoft.com [Thu, 25 Feb 2010 17:40:48 +0000 (17:40 +0000)] 
Add comment

9 years agoChange pretty printing of InlinePrag slightly
simonpj@microsoft.com [Thu, 25 Feb 2010 17:40:28 +0000 (17:40 +0000)] 
Change pretty printing of InlinePrag slightly

9 years agoAdd -no-auto-link-packages docs to the user guide; fixes trac #3759
Ian Lynagh [Sun, 28 Feb 2010 19:18:37 +0000 (19:18 +0000)] 
Add -no-auto-link-packages docs to the user guide; fixes trac #3759

9 years agoWhitespace only in docs/users_guide/packages.xml
Ian Lynagh [Sun, 28 Feb 2010 18:29:45 +0000 (18:29 +0000)] 
Whitespace only in docs/users_guide/packages.xml

9 years agoAdd a LICENSE file to libraries/bin-package-db
Ian Lynagh [Sat, 27 Feb 2010 20:56:26 +0000 (20:56 +0000)] 
Add a LICENSE file to libraries/bin-package-db
Silences a (harmless) error from tar when making bindists

9 years agoHave separate rules to generate tags and TAGS
Ian Lynagh [Sat, 27 Feb 2010 20:25:17 +0000 (20:25 +0000)] 
Have separate rules to generate tags and TAGS
This works around the two filenames being the same on case-insensitive
file systems.

9 years agoFix trac #2578
Ian Lynagh [Sat, 27 Feb 2010 17:39:51 +0000 (17:39 +0000)] 
Fix trac #2578
We define empty datatypes as not being enumerations, which means the
empty blocks aren't generated.

9 years agoFix the build with GHC < 6.12
Ian Lynagh [Fri, 26 Feb 2010 22:39:31 +0000 (22:39 +0000)] 
Fix the build with GHC < 6.12

9 years agoupdate the docs to reflect changes in the tracing flags
Simon Marlow [Fri, 26 Feb 2010 11:12:05 +0000 (11:12 +0000)] 
update the docs to reflect changes in the tracing flags

9 years agoTweak the tracing flags slightly, and clean up error handling and diagnostics
Simon Marlow [Fri, 26 Feb 2010 11:06:08 +0000 (11:06 +0000)] 
Tweak the tracing flags slightly, and clean up error handling and diagnostics

Tracing flags are now:

   -l[flags]  Log events in binary format to the file <program>.eventlog
   -v[flags]  Log events to stderr
              where [flags] can contain:
                 s    scheduler events
                 t    add time stamps (only useful with -v)

and there are more helpful error messages when using flags that are
only available in particular variants of the RTS:

 the flag -v requires the program to be built with -debug
 the flag -Ds requires the program to be built with -debug
 the flag -p requires the program to be built with -prof
 the flag -N requires the program to be built with -threaded
 the flag -v requires the program to be built with -debug

Also, I fixed the crash reported in #3874, with +RTS -ls -v.

9 years agoFix crash when using printf format specifiers in traceEvent (#3874)
Simon Marlow [Fri, 26 Feb 2010 09:32:15 +0000 (09:32 +0000)] 
Fix crash when using printf format specifiers in traceEvent (#3874)

9 years agohack to make the docs build again in a lndir build tree (see comments)
Simon Marlow [Thu, 25 Feb 2010 13:16:16 +0000 (13:16 +0000)] 
hack to make the docs build again in a lndir build tree (see comments)

9 years agoForce encoding to UTF-8 when writing individual .conf files
Simon Marlow [Wed, 24 Feb 2010 15:25:19 +0000 (15:25 +0000)] 
Force encoding to UTF-8 when writing individual .conf files

9 years agoFix build for non-x86 arches again.
Ben.Lippmeier@anu.edu.au [Mon, 22 Feb 2010 07:51:44 +0000 (07:51 +0000)] 
Fix build for non-x86 arches again.

9 years agoFix the link to the ghc docs in libraries/prologue.txt
Ian Lynagh [Tue, 23 Feb 2010 18:16:44 +0000 (18:16 +0000)] 
Fix the link to the ghc docs in libraries/prologue.txt

9 years agoFix more library links in the user guide
Ian Lynagh [Tue, 23 Feb 2010 16:45:51 +0000 (16:45 +0000)] 
Fix more library links in the user guide

9 years agoFix the links to the base docs from the user guide
Ian Lynagh [Tue, 23 Feb 2010 15:05:22 +0000 (15:05 +0000)] 
Fix the links to the base docs from the user guide

9 years agoRemove old, unused release notes
Ian Lynagh [Tue, 23 Feb 2010 15:03:27 +0000 (15:03 +0000)] 
Remove old, unused release notes

9 years agoFix #3875: Crash in parallel GC, wrong pointer was being tested.
Ben.Lippmeier@anu.edu.au [Mon, 22 Feb 2010 03:16:27 +0000 (03:16 +0000)] 
Fix #3875: Crash in parallel GC, wrong pointer was being tested.

9 years agoAdd utils/ghctags/ghc.mk
Ian Lynagh [Sun, 21 Feb 2010 18:52:00 +0000 (18:52 +0000)] 
Add utils/ghctags/ghc.mk

9 years agoMake "make tags" work in the new build system
Ian Lynagh [Sun, 21 Feb 2010 16:44:32 +0000 (16:44 +0000)] 
Make "make tags" work in the new build system

9 years agoRemove the old hstags util
Ian Lynagh [Sat, 20 Feb 2010 23:59:09 +0000 (23:59 +0000)] 
Remove the old hstags util

9 years agoCheck for suitable versions of make in bindists; fixes trac #3860
Ian Lynagh [Sat, 20 Feb 2010 21:11:57 +0000 (21:11 +0000)] 
Check for suitable versions of make in bindists; fixes trac #3860
We already had a check in configure of the actual build. This patch
adds it to the configure of the bindists too.

9 years agoFix build on Windows
Ian Lynagh [Fri, 19 Feb 2010 13:42:22 +0000 (13:42 +0000)] 
Fix build on Windows

9 years agoUse the shared C wrapper code in ghci.c too
Ian Lynagh [Thu, 18 Feb 2010 17:17:16 +0000 (17:17 +0000)] 
Use the shared C wrapper code in ghci.c too

9 years agoRefactor gcc.c, pulling out the reusable code
Ian Lynagh [Thu, 18 Feb 2010 17:09:31 +0000 (17:09 +0000)] 
Refactor gcc.c, pulling out the reusable code

9 years agoFix a recompilation checking bug when a package dependency changes
Simon Marlow [Wed, 17 Feb 2010 13:32:50 +0000 (13:32 +0000)] 
Fix a recompilation checking bug when a package dependency changes

We weren't forcing enough recompilationg when package dependencies
changed, with the result that bumping a package version could lead to
linking failures or other problems later.

The problem/solutation are described on the wiki:

http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/RecompilationAvoidance#Packageversionchanges

9 years agodarcs-all --extra get: gets a few extra packages
Simon Marlow [Wed, 17 Feb 2010 10:46:34 +0000 (10:46 +0000)] 
darcs-all --extra get: gets a few extra packages
currently deepseq, parallel, stm.

9 years agoAllow extra packages to be added to the build, by setting $(EXTRA_PACKAGES)
Simon Marlow [Wed, 17 Feb 2010 10:31:34 +0000 (10:31 +0000)] 
Allow extra packages to be added to the build, by setting $(EXTRA_PACKAGES)

9 years agoBeef up cmmMiniInline a tiny bit
Simon Marlow [Tue, 16 Feb 2010 15:05:06 +0000 (15:05 +0000)] 
Beef up cmmMiniInline a tiny bit
Allow a temporary assignment to be pushed past an assignment to a
global if the global is not mentioned in the rhs of the assignment we
are inlining.

This fixes up some bad code.  We should make sure we're doing
something equivalent in the new backend in due course.

9 years agoWrite the binary cache file atomically
Simon Marlow [Tue, 16 Feb 2010 13:48:41 +0000 (13:48 +0000)] 
Write the binary cache file atomically
Should fix an occasional build error of the form
 ghc-pkg: too few bytes. Failed reading at byte position 8

9 years agodisable a false assertion, with a comment to explain why
Simon Marlow [Tue, 16 Feb 2010 12:35:44 +0000 (12:35 +0000)] 
disable a false assertion, with a comment to explain why

9 years agoFix a bug that can lead to noDuplicate# not working sometimes.
Simon Marlow [Tue, 16 Feb 2010 12:34:11 +0000 (12:34 +0000)] 
Fix a bug that can lead to noDuplicate# not working sometimes.

The symptom is that under some rare conditions when running in
parallel, an unsafePerformIO or unsafeInterleaveIO computation might
be duplicated, so e.g. lazy I/O might give the wrong answer (the
stream might appear to have duplicate parts or parts missing).

I have a program that demonstrates it -N3 or more, some lazy I/O, and
a lot of shared mutable state.  See the comment with stg_noDuplicatezh
in PrimOps.cmm that explains the problem and the fix.  This took me
about a day to find :-(

9 years agoRepresent the free register set using Word64 on x86-64 (fixes ffi009)
Simon Marlow [Mon, 15 Feb 2010 13:01:02 +0000 (13:01 +0000)] 
Represent the free register set using Word64 on x86-64 (fixes ffi009)
Following recent changes to the numbering of registers, we overflowed
Word32 on x86-64, with the result that xmm8 and later we not being
allocated.

9 years agofix lost context switches in GHCi (fixes test 3429(ghci))
Simon Marlow [Mon, 15 Feb 2010 09:32:05 +0000 (09:32 +0000)] 
fix lost context switches in GHCi (fixes test 3429(ghci))

9 years agoFix build for non-x86 architectures
Ben.Lippmeier@anu.edu.au [Mon, 15 Feb 2010 01:47:19 +0000 (01:47 +0000)] 
Fix build for non-x86 architectures

9 years agoAdd comments about the ForceSpecConstr mechanism
Roman Leshchinskiy [Mon, 15 Feb 2010 03:01:03 +0000 (03:01 +0000)] 
Add comments about the ForceSpecConstr mechanism

9 years agoSpot ForceSpecConstr arguments in polymorphic loops
Roman Leshchinskiy [Mon, 15 Feb 2010 02:53:08 +0000 (02:53 +0000)] 
Spot ForceSpecConstr arguments in polymorphic loops

9 years agoDon't rely on tar supporting -z; trac #3841
Ian Lynagh [Sun, 14 Feb 2010 22:04:50 +0000 (22:04 +0000)] 
Don't rely on tar supporting -z; trac #3841

9 years agodon't constant fold division that would result in negative zero (#3676)
Simon Marlow [Thu, 11 Feb 2010 13:15:43 +0000 (13:15 +0000)] 
don't constant fold division that would result in negative zero (#3676)

9 years agoImprove error dump in TcEnv
simonpj@microsoft.com [Wed, 10 Feb 2010 14:52:10 +0000 (14:52 +0000)] 
Improve error dump in TcEnv

9 years agoKeep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845
simonpj@microsoft.com [Wed, 10 Feb 2010 14:51:55 +0000 (14:51 +0000)] 
Keep track of explicit kinding in HsTyVarBndr; plus fix Trac #3845

To print HsTypes correctly we should remember whether the Kind on
a HsTyVarBndr came from type inference, or was put there by the
user.  See Note [Printing KindedTyVars] in HsTypes.  So instead of
changing a UserTyVar to a KindedTyVar during kind checking, we
simply add a PostTcKind to the UserTyVar.

The change was provoked by Trac #3830, although other changes
mean that #3830 gets a diferent and better error message now.
So this patch is simply doing the Right Thing for the future.

This patch also fixes Trac #3845, which was caused by a *type splice*
not remembering the free *term variables* mentioned in it.  Result
was that we build a 'let' when it should have been 'letrec'.
Hence a new FreeVars field in HsSpliceTy.

While I was at it, I got rid of HsSpliceTyOut and use a PostTcKind
on HsSpliceTy instead, just like on the UserTyVar.

9 years agoDocumentation for changes to Template Haskell and quasi-quotation
simonpj@microsoft.com [Wed, 10 Feb 2010 11:42:13 +0000 (11:42 +0000)] 
Documentation for changes to Template Haskell and quasi-quotation

9 years agoRemove redundant import
simonpj@microsoft.com [Mon, 8 Feb 2010 16:57:56 +0000 (16:57 +0000)] 
Remove redundant import

9 years agoStop fruitless ANF-ing
simonpj@microsoft.com [Wed, 10 Feb 2010 09:47:33 +0000 (09:47 +0000)] 
Stop fruitless ANF-ing

The simplifier is taking more iterations than it should, because we
were fruitlessly ANF-ing a top-level declaration of form

   x = Ptr "foo"#

to get

   x = let v = "foo"# in Ptr v

and then inlining v again.  This patch makes Simplify.makeTrivial
top-level aware, so that it doesn't ANF if it's going to be undone.

9 years agoComments only
simonpj@microsoft.com [Wed, 10 Feb 2010 09:45:37 +0000 (09:45 +0000)] 
Comments only

9 years agoSimplify syntax for quasi-quotation
simonpj@microsoft.com [Wed, 10 Feb 2010 09:44:19 +0000 (09:44 +0000)] 
Simplify syntax for quasi-quotation

After some discussion we decided to make a quasi-quote look like

   [pads| ...blah... |]

rather than

   [$pads| ...blah... |]

as before. The new syntax is quieter, although it does not signal
quite as clearly that there is a splice going on.

9 years agoSeveral TH/quasiquote changes
simonpj@microsoft.com [Wed, 10 Feb 2010 09:39:10 +0000 (09:39 +0000)] 
Several TH/quasiquote changes

a) Added quasi-quote forms for
      declarations
      types
   e.g.   f :: [$qq| ... |]

b) Allow Template Haskell pattern quotes (but not splices)
   e.g.  f x = [p| Int -> $x |]

c) Improve pretty-printing for HsPat to remove superfluous
   parens.  (This isn't TH related really, but it affects
   some of the same code.)

A consequence of (a) is that when gathering and grouping declarations
in RnSource.findSplice, we must expand quasiquotes as we do so.
Otherwise it's all fairly straightforward.  I did a little bit of
refactoring in TcSplice.

User-manual changes still to come.

9 years agogenerate slightly better code for ccall argument-pushing on x86
Simon Marlow [Tue, 9 Feb 2010 10:11:14 +0000 (10:11 +0000)] 
generate slightly better code for ccall argument-pushing on x86

9 years ago--lazy overrides --partial too
Simon Marlow [Tue, 9 Feb 2010 09:39:27 +0000 (09:39 +0000)] 
--lazy overrides --partial too
At least until we switch to --lazy being the default

9 years agoFix Trac #3850
simonpj@microsoft.com [Mon, 8 Feb 2010 16:37:51 +0000 (16:37 +0000)] 
Fix Trac #3850

This patch simply avoids a needless difference in behaviour from
6.10, and one that happens to affect HList. See Note [Stupid theta].

9 years agoFix a bug introduced in the SSE2 support: callClobberedRegs was wrong
Simon Marlow [Fri, 5 Feb 2010 11:29:38 +0000 (11:29 +0000)] 
Fix a bug introduced in the SSE2 support: callClobberedRegs was wrong

9 years agoImplement SSE2 floating-point support in the x86 native code generator (#594)
Simon Marlow [Thu, 4 Feb 2010 10:48:49 +0000 (10:48 +0000)] 
Implement SSE2 floating-point support in the x86 native code generator (#594)

The new flag -msse2 enables code generation for SSE2 on x86.  It
results in substantially faster floating-point performance; the main
reason for doing this was that our x87 code generation is appallingly
bad, and since we plan to drop -fvia-C soon, we need a way to generate
half-decent floating-point code.

The catch is that SSE2 is only available on CPUs that support it (P4+,
AMD K8+).  We'll have to think hard about whether we should enable it
by default for the libraries we ship.  In the meantime, at least
-msse2 should be an acceptable replacement for "-fvia-C
-optc-ffast-math -fexcess-precision".

SSE2 also has the advantage of performing all operations at the
correct precision, so floating-point results are consistent with other
platforms.

I also tweaked the x87 code generation a bit while I was here, now
it's slighlty less bad than before.

9 years agoadd libraries/binary
Simon Marlow [Wed, 3 Feb 2010 13:54:21 +0000 (13:54 +0000)] 
add libraries/binary

9 years agoadd comment for srt_bitmap field
Simon Marlow [Wed, 3 Feb 2010 10:34:31 +0000 (10:34 +0000)] 
add comment for srt_bitmap field