ghc.git
5 years agorts: detabify/dewhitespace StgPrimFloat.c
Austin Seipp [Wed, 20 Aug 2014 17:26:29 +0000 (12:26 -0500)] 
rts: detabify/dewhitespace StgPrimFloat.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace StgStartup.cmm
Austin Seipp [Wed, 20 Aug 2014 17:26:04 +0000 (12:26 -0500)] 
rts: detabify/dewhitespace StgStartup.cmm

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace StgStdThunks.cmm
Austin Seipp [Wed, 20 Aug 2014 17:25:52 +0000 (12:25 -0500)] 
rts: detabify/dewhitespace StgStdThunks.cmm

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace AutoApply.h
Austin Seipp [Wed, 20 Aug 2014 17:25:24 +0000 (12:25 -0500)] 
rts: detabify/dewhitespace AutoApply.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Task.h
Austin Seipp [Wed, 20 Aug 2014 17:24:37 +0000 (12:24 -0500)] 
rts: detabify/dewhitespace Task.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Printer.h
Austin Seipp [Wed, 20 Aug 2014 17:24:19 +0000 (12:24 -0500)] 
rts: detabify/dewhitespace Printer.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Hpc.c
Austin Seipp [Wed, 20 Aug 2014 17:22:48 +0000 (12:22 -0500)] 
rts: detabify/dewhitespace Hpc.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Apply.cmm
Austin Seipp [Wed, 20 Aug 2014 17:22:24 +0000 (12:22 -0500)] 
rts: detabify/dewhitespace Apply.cmm

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace sm/MBlock.c
Austin Seipp [Wed, 20 Aug 2014 17:21:10 +0000 (12:21 -0500)] 
rts: detabify/dewhitespace sm/MBlock.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace sm/GCUtils.c
Austin Seipp [Wed, 20 Aug 2014 17:21:03 +0000 (12:21 -0500)] 
rts: detabify/dewhitespace sm/GCUtils.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace sm/GCUtils.h
Austin Seipp [Wed, 20 Aug 2014 17:20:41 +0000 (12:20 -0500)] 
rts: detabify/dewhitespace sm/GCUtils.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace sm/GCAux.c
Austin Seipp [Wed, 20 Aug 2014 17:20:17 +0000 (12:20 -0500)] 
rts: detabify/dewhitespace sm/GCAux.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace sm/MarkWeak.c
Austin Seipp [Wed, 20 Aug 2014 17:19:48 +0000 (12:19 -0500)] 
rts: detabify/dewhitespace sm/MarkWeak.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace sm/BlockAlloc.c
Austin Seipp [Wed, 20 Aug 2014 17:19:20 +0000 (12:19 -0500)] 
rts: detabify/dewhitespace sm/BlockAlloc.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace sm/Storage.h
Austin Seipp [Wed, 20 Aug 2014 17:18:42 +0000 (12:18 -0500)] 
rts: detabify/dewhitespace sm/Storage.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Task.c
Austin Seipp [Wed, 20 Aug 2014 17:17:50 +0000 (12:17 -0500)] 
rts: detabify/dewhitespace Task.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: reflow some comments in STM.c
Austin Seipp [Wed, 20 Aug 2014 17:17:25 +0000 (12:17 -0500)] 
rts: reflow some comments in STM.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace STM.c
Austin Seipp [Wed, 20 Aug 2014 17:16:40 +0000 (12:16 -0500)] 
rts: detabify/dewhitespace STM.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Trace.c
Austin Seipp [Wed, 20 Aug 2014 17:16:09 +0000 (12:16 -0500)] 
rts: detabify/dewhitespace Trace.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Timer.c
Austin Seipp [Wed, 20 Aug 2014 17:15:58 +0000 (12:15 -0500)] 
rts: detabify/dewhitespace Timer.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Updates.h
Austin Seipp [Wed, 20 Aug 2014 17:15:15 +0000 (12:15 -0500)] 
rts: detabify/dewhitespace Updates.h

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Weak.c
Austin Seipp [Wed, 20 Aug 2014 17:14:33 +0000 (12:14 -0500)] 
rts: detabify/dewhitespace Weak.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agorts: detabify/dewhitespace Ticky.c
Austin Seipp [Wed, 20 Aug 2014 17:13:45 +0000 (12:13 -0500)] 
rts: detabify/dewhitespace Ticky.c

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd a missing newline to a GHCi linker debugBelch
Reid Barton [Wed, 20 Aug 2014 16:17:16 +0000 (12:17 -0400)] 
Add a missing newline to a GHCi linker debugBelch

5 years agoUpdate a comment in base cbits
Reid Barton [Wed, 20 Aug 2014 14:42:10 +0000 (10:42 -0400)] 
Update a comment in base cbits

5 years agogenprimopcode: Don't output tabs
Austin Seipp [Wed, 20 Aug 2014 12:12:01 +0000 (07:12 -0500)] 
genprimopcode: Don't output tabs

Otherwise the build breaks, because its output is included in tab-free
files. See ef9dd9f.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agobasicTypes: detabify/dewhitespace IdInfo
Austin Seipp [Wed, 20 Aug 2014 08:46:22 +0000 (03:46 -0500)] 
basicTypes: detabify/dewhitespace IdInfo

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agobasicTypes: detabify/dewhitespace NameEnv
Austin Seipp [Wed, 20 Aug 2014 08:45:44 +0000 (03:45 -0500)] 
basicTypes: detabify/dewhitespace NameEnv

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agobasicTypes: detabify/dewhitespace NameSet
Austin Seipp [Wed, 20 Aug 2014 08:45:15 +0000 (03:45 -0500)] 
basicTypes: detabify/dewhitespace NameSet

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agobasicTypes: detabify/dewhitespace Var
Austin Seipp [Wed, 20 Aug 2014 08:44:52 +0000 (03:44 -0500)] 
basicTypes: detabify/dewhitespace Var

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agohsSyn: detabify/dewhitespace HsLit
Austin Seipp [Wed, 20 Aug 2014 08:43:14 +0000 (03:43 -0500)] 
hsSyn: detabify/dewhitespace HsLit

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agostranal: detabify/dewhitespace DmdAnal
Austin Seipp [Wed, 20 Aug 2014 08:42:38 +0000 (03:42 -0500)] 
stranal: detabify/dewhitespace DmdAnal

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agodeSugar: detabify/dewhitespace DsCCall
Austin Seipp [Wed, 20 Aug 2014 08:41:32 +0000 (03:41 -0500)] 
deSugar: detabify/dewhitespace DsCCall

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agocoreSyn: detabify/dewhitespace CoreSubst
Austin Seipp [Wed, 20 Aug 2014 08:40:18 +0000 (03:40 -0500)] 
coreSyn: detabify/dewhitespace CoreSubst

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agocoreSyn: detabify/dewhitespace CoreTidy
Austin Seipp [Wed, 20 Aug 2014 08:39:40 +0000 (03:39 -0500)] 
coreSyn: detabify/dewhitespace CoreTidy

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoprelude: detabify/dewhitespace TysPrim
Austin Seipp [Wed, 20 Aug 2014 08:38:01 +0000 (03:38 -0500)] 
prelude: detabify/dewhitespace TysPrim

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agosimplCore: detabify/dewhitespace LiberateCase
Austin Seipp [Wed, 20 Aug 2014 08:36:39 +0000 (03:36 -0500)] 
simplCore: detabify/dewhitespace LiberateCase

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agosimplCore: detabify/dewhitespace SetLevels
Austin Seipp [Wed, 20 Aug 2014 08:35:36 +0000 (03:35 -0500)] 
simplCore: detabify/dewhitespace SetLevels

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoutils: detabify/dewhitespace GraphPpr
Austin Seipp [Wed, 20 Aug 2014 08:33:57 +0000 (03:33 -0500)] 
utils: detabify/dewhitespace GraphPpr

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoutils: detabify/dewhitespace GraphBase
Austin Seipp [Wed, 20 Aug 2014 08:33:28 +0000 (03:33 -0500)] 
utils: detabify/dewhitespace GraphBase

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoutils: detabify/dewhitespace BufWrite
Austin Seipp [Wed, 20 Aug 2014 08:33:02 +0000 (03:33 -0500)] 
utils: detabify/dewhitespace BufWrite

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agosimplCore: detabify/dewhitespace SAT
Austin Seipp [Wed, 20 Aug 2014 08:31:49 +0000 (03:31 -0500)] 
simplCore: detabify/dewhitespace SAT

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agostranal: detabify/dewhitespace WorkWrap
Austin Seipp [Wed, 20 Aug 2014 08:31:18 +0000 (03:31 -0500)] 
stranal: detabify/dewhitespace WorkWrap

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agocoreSyn: detabify/dewhitespace TrieMap
Austin Seipp [Wed, 20 Aug 2014 08:29:49 +0000 (03:29 -0500)] 
coreSyn: detabify/dewhitespace TrieMap

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoComments fix to Trac #9140
Simon Peyton Jones [Wed, 20 Aug 2014 08:12:55 +0000 (09:12 +0100)] 
Comments fix to Trac #9140

5 years agoMake sure that a prototype is included for 'setIOManagerControlFd'
Gabor Greif [Tue, 19 Aug 2014 22:32:58 +0000 (00:32 +0200)] 
Make sure that a prototype is included for 'setIOManagerControlFd'

5 years agoFix prepositions in the documentation of -rdynamic.
Facundo Domínguez [Tue, 19 Aug 2014 19:10:32 +0000 (16:10 -0300)] 
Fix prepositions in the documentation of -rdynamic.

5 years agovalidate: add simple CPU count autodetection
Sergei Trofimovich [Tue, 19 Aug 2014 13:54:13 +0000 (16:54 +0300)] 
validate: add simple CPU count autodetection

Summary: Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Test Plan: ran ./validate on linux

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D146

5 years agorts/base: Fix #9423
Andreas Voellmy [Tue, 19 Aug 2014 13:02:18 +0000 (08:02 -0500)] 
rts/base: Fix #9423

Summary:
Fix #9423.

The problem in #9423 is caused when code invoked by `hs_exit()` waits
on all foreign calls to return, but some IO managers are in `safe` foreign
calls and do not return. The previous design signaled to the timer manager
(via its control pipe) that it should "die" and when the timer manager
returned to Haskell-land, the Haskell code in timer manager then signalled
to the IO manager threads that they should return from foreign calls and
`die`. Unfortunately, in the shutdown sequence the timer manager is unable
to return to Haskell-land fast enough and so the code that signals to the
IO manager threads (via their control pipes) is never executed and the IO
manager threads remain out in the foreign calls.

This patch solves this problem by having the RTS signal to all the IO
manager threads (via their control pipes; and in addition to signalling
to the timer manager thread) that they should shutdown (in `ioManagerDie()`
in `rts/Signals.c`. To do this, we arrange for each IO manager thread to
register its control pipe with the RTS (in `GHC.Thread.startIOManagerThread`).
In addition, `GHC.Thread.startTimerManagerThread` registers its control pipe.
These are registered via C functions `setTimerManagerControlFd` (in
`rts/Signals.c`) and `setIOManagerControlFd` (in `rts/Capability.c`). The IO
manager control pipe file descriptors are stored in a new field of the
`Capability_ struct`.

Test Plan: See the notes on #9423 to recreate the problem and to verify that it no longer occurs with the fix.

Auditors: simonmar

Reviewers: simonmar, edsko, ezyang, austin

Reviewed By: austin

Subscribers: phaskell, simonmar, ezyang, carter, relrod

Differential Revision: https://phabricator.haskell.org/D129

GHC Trac Issues: #9423, #9284

5 years agotravis: Use hvr’s multi-ghc-PPA
Joachim Breitner [Tue, 19 Aug 2014 12:03:05 +0000 (14:03 +0200)] 
travis: Use hvr’s multi-ghc-PPA

5 years agoCheck if file is present instead of directory
Thomas Miedema [Fri, 20 Jun 2014 23:57:53 +0000 (01:57 +0200)] 
Check if file is present instead of directory

Fixes #8886.

Problem: any `sync-all` command that is run before the first succesfull
`sync-all get` would trigger a false warning about an old `time` package
being present.

Cause: after cloning the ghc repository, the (empty) `libraries/time`
directory is already present.

Solution: check if the directory actually contains any of the `time`
files. I picked the `LICENSE` file, since `boot` does so as well.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoCorrect checkStrictBinds for generalised type
archblob [Tue, 19 Aug 2014 11:51:38 +0000 (06:51 -0500)] 
Correct checkStrictBinds for generalised type

See Trac #9140.

Auditors: simonpj

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoAdd test case for #9046
Vitaly Bragilevsky [Tue, 8 Jul 2014 17:05:05 +0000 (21:05 +0400)] 
Add test case for #9046

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agobuild: require GHC 7.6 for bootstrapping
Austin Seipp [Tue, 19 Aug 2014 11:36:02 +0000 (06:36 -0500)] 
build: require GHC 7.6 for bootstrapping

Summary:
Per the usual standards, a build of GHC is only compileable
by the last two releases (e.g. 7.8 only by 7.4 and 7.6). To make sure
we don't get suckered into supporting older compilers, let's remove
this support now.

Signed-off-by: Austin Seipp <austin@well-typed.com>
Test Plan:
Try to bootstrap with GHC 7.4, watch it fail. Bootstrap
with 7.6 or better, and everything works.

Reviewers: hvr

Reviewed By: hvr

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D167

5 years agoMention that `Data.Ix` uses row-major indexing
Alexander Berntsen [Fri, 16 May 2014 15:32:04 +0000 (17:32 +0200)] 
Mention that `Data.Ix` uses row-major indexing

This addresses Trac #8712 by simply mentioning row-major indexing,
thereby removing any ambiguity.

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoExplain how to clone GitHub forks. Ticket #8379.
Thomas Miedema [Fri, 20 Jun 2014 23:07:59 +0000 (01:07 +0200)] 
Explain how to clone GitHub forks. Ticket #8379.

This information is mirrored at:
http://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources#GettingaGHCrepositoryfromGitHub

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoUse absolute links to Cabal docs from the GHC users guide (#9154)
Bob Ippolito [Fri, 30 May 2014 16:31:34 +0000 (09:31 -0700)] 
Use absolute links to Cabal docs from the GHC users guide (#9154)

Signed-off-by: Austin Seipp <austin@well-typed.com>
5 years agoincludes/stg/Prim.h: add matching 'hs_atomic_*' prototypes
Sergei Trofimovich [Tue, 19 Aug 2014 07:05:43 +0000 (10:05 +0300)] 
includes/stg/Prim.h: add matching 'hs_atomic_*' prototypes

Fixes implicit function declarations in C codegen.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
5 years agoThis note's name has been fixed
Gabor Greif [Tue, 19 Aug 2014 06:35:06 +0000 (08:35 +0200)] 
This note's name has been fixed

5 years agoHave the RTS linker search symbols in the originating windows binary.
Facundo Domínguez [Tue, 19 Aug 2014 02:50:33 +0000 (21:50 -0500)] 
Have the RTS linker search symbols in the originating windows binary.

Summary: In initLinker, this patch adds the handle of the module corresponding to the program binary to the list of DLL handles that lookupSymbol uses to search for symbols.

Test Plan: validate

Reviewers: simonmar, austin

Reviewed By: simonmar, austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D103

GHC Trac Issues: #9382

5 years agoImplement -rdynamic in Linux and Windows/MinGW32.
Facundo Domínguez [Tue, 19 Aug 2014 02:50:15 +0000 (21:50 -0500)] 
Implement -rdynamic in Linux and Windows/MinGW32.

Summary:
In Linux, it is a synonym for -optl -rdynamic.
In Windows, it is a synonym for -optl -export-all-symbols.

Test Plan: validate

Reviewers: simonmar, austin

Reviewed By: simonmar, austin

Subscribers: mboes, phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D102

GHC Trac Issues: #9381

5 years agoUNREG: fix PackageKey emission into .hc files
Sergei Trofimovich [Tue, 19 Aug 2014 02:45:11 +0000 (21:45 -0500)] 
UNREG: fix PackageKey emission into .hc files

Summary:
Fixes ./configure --unable-unregisterised build failure:
    HC [stage 1] (one of the first calls)
    ...
    <command line>: unknown package: transformers-0.4.1.0

The reason of bug is how UNREG build stores package information
in .hc files:
    compiler/main/CodeOutput.lhs generates first line as
        /* GHC_PACKAGES pkg-name-ver1 pkg-name-ver2 ...
    while DriverPipeline.hs (getHCFilePackages) expects
        /* GHC_PACKAGES pkg-key1 pkg-key2 ...

Fix it by emitting ghc's PackageKey in CodeOutput

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Test Plan: build-tested on ./configure --enable-unregistersied

Reviewers: simonmar, ezyang, austin

Reviewed By: ezyang, austin

Subscribers: simonmar, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D164

5 years agoBug #9439: Ensure that stage 0 compiler isn't affected
Ben Gamari [Tue, 19 Aug 2014 02:44:25 +0000 (21:44 -0500)] 
Bug #9439: Ensure that stage 0 compiler isn't affected

Summary:
Bug #9439 will cause miscompilation of GHC's LLVM backend. Here we
ensure that an affected compiler isn't used to bootstrap.

Test Plan: Attempt to bootstrap GHC with an affected stage 0 compiler.

Reviewers: rwbarton, austin

Reviewed By: austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D159

5 years agoMake Prelude.signum handle -0.0 correctly (#7858)
Alexander Berntsen [Tue, 19 Aug 2014 02:43:33 +0000 (21:43 -0500)] 
Make Prelude.signum handle -0.0 correctly (#7858)

Summary:
Make the `Float` and `Double` implementations of `signum` handle -0.0
correctly per IEEE-754.

This, together with "Make Prelude.abs handle -0.0 correctly (#7858)",
fixes Trac #7858.

Depends on D145

Signed-off-by: Alexander Berntsen <alexander@plaimi.net>
Test Plan:
signum of (-0.0) should be (-0.0) not 0.0.

Test program:

  main =
    putStrLn $ p ++ " " ++ n
    where
      f = show . signum
      p = f (-0.0 :: Double)
    n = f (0.0 :: Double)

Reviewers: ekmett, hvr, rwbarton, austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D148

GHC Trac Issues: #7858

5 years agoMake Prelude.abs handle -0.0 correctly (#7858)
Alexander Berntsen [Tue, 19 Aug 2014 02:42:12 +0000 (21:42 -0500)] 
Make Prelude.abs handle -0.0 correctly (#7858)

Summary:
Make the `Float` and `Double` implementations of `abs` handle -0.0
correctly per IEEE-754.

abs (-0.0::Float) and abs (-0.0::Double) previously returned -0.0, when
they should return 0.0. This patch fixes this.

Signed-off-by: Alexander Berntsen <alexander@plaimi.net>
Test Plan: abs (-0.0::Double) should = 0.0 instead of (-0.0)

Reviewers: ekmett, hvr, austin, rwbarton

Reviewed By: austin, rwbarton

Subscribers: phaskell, trofi, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D145

GHC Trac Issues: #7858

5 years agotestsuite/T9379: Use GHC.Conc instead of Control.Concurrent.STM
Ben Gamari [Tue, 19 Aug 2014 02:40:21 +0000 (21:40 -0500)] 
testsuite/T9379: Use GHC.Conc instead of Control.Concurrent.STM

Summary:
`GHC.Conc` provides almost everything we need.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
Test Plan:
    make test TEST=T9379

Reviewers: austin, simonmar

Reviewed By: austin, simonmar

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D152

5 years agoFix three problems with occurrence analysis on case alternatives.
Andrew Farmer [Tue, 19 Aug 2014 02:40:12 +0000 (21:40 -0500)] 
Fix three problems with occurrence analysis on case alternatives.

Summary:
  1. Respect condition (a) in Note [Binder swap]
  2. Respect condition (b) in Note [Binder swap]
  3. Return usage of any coercion variables in binder swap

Fixes T9440

Test Plan: See #9440

Reviewers: simonpj, austin

Reviewed By: simonpj, austin

Subscribers: simonpj, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D156

GHC Trac Issues: #9440

5 years agoconcurrent/should_run/throwto002: DoRec -> RecursiveDo
Ben Gamari [Tue, 19 Aug 2014 02:38:37 +0000 (21:38 -0500)] 
concurrent/should_run/throwto002: DoRec -> RecursiveDo

Summary: Test case used old extension name; update it.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D161

5 years agoghci/scripts/ghci016: Add implementation for negate
Ben Gamari [Tue, 19 Aug 2014 02:37:15 +0000 (21:37 -0500)] 
ghci/scripts/ghci016: Add implementation for negate

Summary: This previously produced a warning

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D162

5 years agoMake T8832 operative on 32-bit systems (#8832)
Reid Barton [Tue, 19 Aug 2014 02:27:38 +0000 (22:27 -0400)] 
Make T8832 operative on 32-bit systems (#8832)

(Also, the 'extra_clean' was unnecessary.)

5 years agoUpdate list of flags implied by -XGADTs in User's Guide section on GADTs
Reid Barton [Mon, 18 Aug 2014 23:39:58 +0000 (19:39 -0400)] 
Update list of flags implied by -XGADTs in User's Guide section on GADTs

5 years agoFix broken link in Data.Data to SYB home page (Trac #9455)
Simon Peyton Jones [Mon, 18 Aug 2014 08:21:42 +0000 (09:21 +0100)] 
Fix broken link in Data.Data to SYB home page (Trac #9455)

Ralf Laemmel's page has disappeared, so I made it point to the Haskell
Wiki page instead.

5 years agoFix quasi-quoter documentation (#9448)
Sergey Vinokurov [Sat, 16 Aug 2014 19:13:41 +0000 (22:13 +0300)] 
Fix quasi-quoter documentation (#9448)

5 years agoworkaround Solaris 11 GNU C CPP issue by using GNU C 3.4 as CPP
Karel Gardas [Sun, 17 Aug 2014 21:26:39 +0000 (23:26 +0200)] 
workaround Solaris 11 GNU C CPP issue by using GNU C 3.4 as CPP

Summary:
Solaris 11 distributed GNU C 4.5.x is configured in a way that its
CPP is not working well while invoked from GHC. GHC runs it with
-x assembler-with-cpp and in this particular configuration GNU C CPP
does not provide any line-markers so GHC's output of errors or warnings
is confusing since it points to preprocessed file in /tmp and not
to the original Haskell file. Fortunately old GNU C 3.4.x is still
provided by the OS and when installed it'll be used automatically
as GHC CPP which is whole logic of this patch. So although we use modern
GCC as a C compiler and assembler we use old GCC as a C preprocessor.

Test Plan: validate

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D151

5 years agoRemove obsolete `digitsTyConKey :: Unique`
Herbert Valerio Riedel [Sat, 16 Aug 2014 18:31:21 +0000 (20:31 +0200)] 
Remove obsolete `digitsTyConKey :: Unique`

This became dead with 1e87c0a6e485e1dbef8e9ed19191e54f6cdc54e0
and was probably just missed.

I plan to re-use the freed up `mkPreludeTyConUnique 23` slot soon
for a new `bigNatTyConKey` (as part of the #9281 effort)

5 years agoWorkaround GCC `__ctzdi2` intrinsic linker errors
Herbert Valerio Riedel [Sun, 17 Aug 2014 10:19:45 +0000 (12:19 +0200)] 
Workaround GCC `__ctzdi2` intrinsic linker errors

On Linux/i386 the 64bit `__builtin_ctzll()` instrinsic doesn't get
inlined by GCC but rather a short `__ctzdi2` runtime function is
inserted when needed into compiled object files.

This causes failures for the four test-cases

  TEST="T8639_api T8628 dynCompileExpr T5313"

with error messages of the kind

  dynCompileExpr: .../libraries/ghc-prim/dist-install/build/libHSghcpr_BE58KUgBe9ELCsPXiJ1Q2r.a: unknown symbol `__ctzdi2'
  dynCompileExpr: dynCompileExpr: unable to load package `ghc-prim'

This workaround forces GCC on 32bit x86 to to express `hs_ctz64` in
terms of the 32bit `__builtin_ctz()` (this is no loss, as there's no
64bit BSF instruction on i686 anyway) and thus avoid the problematic
out-of-line runtime function.

Note: `__builtin_ctzll()` is used since
      e0c1767d0ea8d12e0a4badf43682a08784e379c6 (re #9340)

5 years agoRevert "Fix typos 'resizze'"
Gabor Greif [Sat, 16 Aug 2014 17:20:18 +0000 (19:20 +0200)] 
Revert "Fix typos 'resizze'"
this is z-encoding (as hvr tells me)

This reverts commit 425d5178af55620efa00e6e16426f491c63ad533.

5 years agoFix typos 'resizze'
Gabor Greif [Sat, 16 Aug 2014 17:10:46 +0000 (19:10 +0200)] 
Fix typos 'resizze'

5 years agoImplement {resize,shrink}MutableByteArray# primops
Herbert Valerio Riedel [Sat, 16 Aug 2014 07:49:30 +0000 (09:49 +0200)] 
Implement {resize,shrink}MutableByteArray# primops

The two new primops with the type-signatures

  resizeMutableByteArray# :: MutableByteArray# s -> Int#
                          -> State# s -> (# State# s, MutableByteArray# s #)

  shrinkMutableByteArray# :: MutableByteArray# s -> Int#
                          -> State# s -> State# s

allow to resize MutableByteArray#s in-place (when possible), and are useful
for algorithms where memory is temporarily over-allocated. The motivating
use-case is for implementing integer backends, where the final target size of
the result is either N or N+1, and only known after the operation has been
performed.

A future commit will implement a stateful variant of the
`sizeofMutableByteArray#` operation (see #9447 for details), since now the
size of a `MutableByteArray#` may change over its lifetime (i.e before
it gets frozen or GCed).

Test Plan: ./validate --slow

Reviewers: ezyang, austin, simonmar

Reviewed By: austin, simonmar

Differential Revision: https://phabricator.haskell.org/D133

5 years agoMake configure's sed(1) expression for GHC_LDFLAGS more BSD-friendly.
Gabor Pali [Fri, 15 Aug 2014 15:45:18 +0000 (16:45 +0100)] 
Make configure's sed(1) expression for GHC_LDFLAGS more BSD-friendly.

5 years agoLlvmMangler: Be more selective when mangling object types
Ben Gamari [Fri, 15 Aug 2014 15:11:17 +0000 (11:11 -0400)] 
LlvmMangler: Be more selective when mangling object types

Summary:
We previously did a wholesale replace of `%function` to `%object` to
mangle object `.type` annotations. This is bad as it can end up
replacing appearances of `"%function"` in the user's code. We now look
for a proper `.type` keyword before performing the replacement.

Thanks to @rwbarton for pointing out the bug.

Test Plan:
Previously,

    $ echo 'main = putStrLn "@function"' > test.hs
    $ ghc -fllvm test.hs
    $ ./test
    @object

Now,
    $ echo 'main = putStrLn "@function"' > test.hs
    $ ghc -fllvm test.hs
    $ ./test
    @function

Reviewers: rwbarton, austin

Reviewed By: rwbarton, austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D150

GHC Trac Issues: #9439

5 years agoDeclare `ghc-head` to be haddock's upstream branch
Herbert Valerio Riedel [Thu, 14 Aug 2014 17:51:01 +0000 (19:51 +0200)] 
Declare `ghc-head` to be haddock's upstream branch

This will affect commands such as

   git submodule update --remote utils/haddock

to use `ghc-head` instead of the default `master` branch

5 years agoImplement new CLZ and CTZ primops (re #9340)
Herbert Valerio Riedel [Mon, 11 Aug 2014 16:56:57 +0000 (18:56 +0200)] 
Implement new CLZ and CTZ primops (re #9340)

This implements the new primops

  clz#, clz32#, clz64#,
  ctz#, ctz32#, ctz64#

which provide efficient implementations of the popular
count-leading-zero and count-trailing-zero respectively
(see testcase for a pure Haskell reference implementation).

On x86, NCG as well as LLVM generates code based on the BSF/BSR
instructions (which need extra logic to make the 0-case well-defined).

Test Plan: validate and succesful tests on i686 and amd64

Reviewers: rwbarton, simonmar, ezyang, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D144

GHC Trac Issues: #9340

5 years agoRemove out of date TODO
Edward Z. Yang [Wed, 13 Aug 2014 16:00:20 +0000 (17:00 +0100)] 
Remove out of date TODO

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years agoExplicitly version test for package key support.
Edward Z. Yang [Wed, 13 Aug 2014 10:30:26 +0000 (11:30 +0100)] 
Explicitly version test for package key support.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
5 years agoHave ghc-pkg use an old-style package key when it's not provided.
Edward Z. Yang [Wed, 13 Aug 2014 13:04:10 +0000 (14:04 +0100)] 
Have ghc-pkg use an old-style package key when it's not provided.

Summary:
When this occurs, it means that the user is using an old version of Cabal.
In that case, don't barf out: just go ahead and install it as an old-style
package key.  The user won't be able to link multiple versions together,
but that should not be a problem because their Cabal can't handle it anyway.

What happens if old-style are mixed up with new-style?  Well, currently
with Cabal, it's indistinguishable.  However, if at some later point we
add private dependencies, libraries compiled with old style linker names
are incompatible with each other.  We'll cross that road when we come
to it.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate

Reviewers: tibbe, hvr, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D154

5 years agoStgCmmPrim: add note to stop using fixed size signed types for sizes
Johan Tibell [Tue, 12 Aug 2014 18:28:14 +0000 (20:28 +0200)] 
StgCmmPrim: add note to stop using fixed size signed types for sizes

We use fixed size signed types to e.g. represent array sizes. This
means that the size can overflow.

5 years agoAdd some Haddocks to SMRep
Johan Tibell [Tue, 12 Aug 2014 07:34:27 +0000 (09:34 +0200)] 
Add some Haddocks to SMRep

5 years agoshouldInlinePrimOp: Fix Int overflow
Johan Tibell [Thu, 7 Aug 2014 15:07:00 +0000 (17:07 +0200)] 
shouldInlinePrimOp: Fix Int overflow

There were two overflow issues in shouldInlinePrimOp. The first one is
due to a negative CmmInt literal being created if the array size was
given as larger than 2^63-1 (on a 64-bit platform.) This meant that
large array sizes could compare as being smaller than
maxInlineAllocSize.

The second issue is that we casted the Integer to an Int in the
comparison, which again meant that large array sizes could compare as
being smaller than maxInlineAllocSize.

The attempt to allocate a large array inline then caused a segfault.

Fixes #9416.

5 years agoTestsuite wibbles around #9200
Richard Eisenberg [Fri, 8 Aug 2014 12:14:52 +0000 (08:14 -0400)] 
Testsuite wibbles around #9200

5 years agoUpdate manual (#9200).
Richard Eisenberg [Thu, 7 Aug 2014 12:53:11 +0000 (08:53 -0400)] 
Update manual (#9200).

5 years agoRemove NonParametricKinds (#9200)
Richard Eisenberg [Thu, 7 Aug 2014 12:37:05 +0000 (08:37 -0400)] 
Remove NonParametricKinds (#9200)

This commit also removes 'KindCheckingStrategy' and related gubbins,
instead including the notion of a CUSK into HsDecls.

5 years agoChange treatment of CUSKs for synonyms and families (#9200).
Richard Eisenberg [Thu, 7 Aug 2014 12:28:32 +0000 (08:28 -0400)] 
Change treatment of CUSKs for synonyms and families (#9200).

5 years agoAdded more testing for #9200. (polykinds/T9200b)
Richard Eisenberg [Thu, 7 Aug 2014 12:19:22 +0000 (08:19 -0400)] 
Added more testing for #9200. (polykinds/T9200b)

5 years agoChange definition of CUSK for data and class definitions (#9200).
Richard Eisenberg [Wed, 6 Aug 2014 13:56:50 +0000 (09:56 -0400)] 
Change definition of CUSK for data and class definitions (#9200).

Now, a CUSK is when (and only when) all type variables are annotated.
This allows classes to participate in polymorphic recursion.

5 years agoTest #9200. (polykinds/T9200)
Richard Eisenberg [Mon, 4 Aug 2014 01:37:45 +0000 (21:37 -0400)] 
Test #9200. (polykinds/T9200)

5 years agoTest #9415 (typecheck/should_fail/T9415)
Richard Eisenberg [Wed, 6 Aug 2014 13:54:37 +0000 (09:54 -0400)] 
Test #9415 (typecheck/should_fail/T9415)

5 years agoFix #9415.
Richard Eisenberg [Wed, 6 Aug 2014 13:51:26 +0000 (09:51 -0400)] 
Fix #9415.

Abort typechecking when we detect a superclass cycle error, as
ambiguity checking in the presence of superclass cycle errors can
cause a loop.

5 years agoFix Trac #9371.
Richard Eisenberg [Sun, 3 Aug 2014 22:40:30 +0000 (18:40 -0400)] 
Fix Trac #9371.

This was very simple: lists of different lengths are
*maybe* apart, not *surely* apart.

5 years agoTest #9371 (indexed-types/should_fail/T9371)
Richard Eisenberg [Sun, 3 Aug 2014 21:54:54 +0000 (17:54 -0400)] 
Test #9371 (indexed-types/should_fail/T9371)