1. 23 Jun, 2017 3 commits
    • Matthew Pickering's avatar
      Use actual universal tvs in check for naughty record selectors · 0e2839a2
      Matthew Pickering authored
      The naughty record selector check means to limit selectors which would
      lead to existential tyvars escaping their scope. With record pattern
      synonyms, there are situations where universal tyvars don't appear in
      the result type, for example:
      pattern ReadP :: Read a => a -> String
      pattern ReadP{readp} <- (read -> readp)
      This is a similar issue to #11224 where we assumed that we can decide
      which variables are universal and which are existential by the syntactic
      check of seeing which appear in the result type. The fix is to use
      `univ_tvs` from `conLikeFullSig` rather than the previous approximation.
      But we must also remember to apply `EqSpec`s so we use the free
      variables from `inst_tys` which is precisely `univ_tvs` with `EqSpecs`
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3649
      (cherry picked from commit 90771209)
    • Ben Gamari's avatar
      testsuite: Fix cabal01 test · 379c07bb
      Ben Gamari authored
      The other-modules field listed things that weren't in fact modules,
      causing this test to fail. See Cabal #4567.
      Test Plan: Validate
      Reviewers: hvr, austin
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3665
      (cherry picked from commit e13edee3)
    • Ben Gamari's avatar
      compiler: Eliminate pprTrace in SPT entry addition codepath · 0fa0d6c2
      Ben Gamari authored
      Test Plan: Load program with StaticPointers into GHCi, ensure no
      tracing output makes it in.
      Reviewers: austin
      Subscribers: rwbarton, thomie, RyanGlScott
      GHC Trac Issues: #12356
      Differential Revision: https://phabricator.haskell.org/D3663
      (cherry picked from commit 84cf095d)
  2. 22 Jun, 2017 7 commits
  3. 19 Jun, 2017 4 commits
  4. 16 Jun, 2017 10 commits
    • Ben Gamari's avatar
      Bump Cabal submodule to · 1ab05dac
      Ben Gamari authored
    • Simon Peyton Jones's avatar
      Fix the treatment of 'closed' definitions · 15af7156
      Simon Peyton Jones authored
      The IdBindingInfo field of ATcId serves two purposes
      - to control generalisation when we have -XMonoLocalBinds
      - to check for floatability when dealing with (static e)
      These are related, but not the same, and they'd becomme confused.
      Trac #13804 showed this up via an example like this:
        f periph = let sr :: forall a. [a] -> [a]
                       sr = if periph then reverse else id
                       sr2 = sr
                       -- The question: is sr2 generalised?
                       -- It should be, because sr has a type sig
                       -- even though it has periph free
                   (sr2 [True], sr2 "c")
      Here sr2 should be generalised, despite the free var 'periph'
      in 'sr' because 'sr' has a closed type signature.
      I documented all this very carefully this time, in TcRnTypes:
        Note [Meaning of IdBindingInfo]
        Note [Bindings with closed types: ClosedTypeId]
      (cherry picked from commit dc8e6861)
    • Ryan Scott's avatar
      GHC.Stats cleanup · 96706799
      Ryan Scott authored
      This does two things:
      * The `RtsTime` type wasn't exported, but it is used as the type of
        several record fields. Let's export it and give it some documentation.
      * Neither `RTSStats` nor `GCDetails` have `Read` or `Show` instances,
        but `GCStats` does! Let's fix this discrepancy.
      Reviewers: austin, hvr, bgamari
      Reviewed By: bgamari
      Subscribers: goldfire, rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3625
      (cherry picked from commit 811a2986)
    • Ben Gamari's avatar
      base: Validate input in setNumCapabilities · a4e78208
      Ben Gamari authored
      Test Plan: validate
      Reviewers: austin, hvr, erikd, simonmar
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13832
      Differential Revision: https://phabricator.haskell.org/D3652
      (cherry picked from commit 98494031)
    • niteria's avatar
      Fix #13807 - foreign import nondeterminism · 40f4efb1
      niteria authored
      The problem was that the generated label included
      a freshly assigned Unique value.
      Test Plan:
      Added a new test and looked at the generated stub:
       #include "HsFFI.h"
       #ifdef __cplusplus
       extern "C" {
       extern HsInt zdmainzdAzdAzuzzlzzgzzg(StgStablePtr the_stableptr);
       extern HsInt zdmainzdAzdAzumkStringWriter(StgStablePtr the_stableptr);
       #ifdef __cplusplus
      Reviewers: simonmar, austin, bgamari
      Reviewed By: simonmar
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13807
      Differential Revision: https://phabricator.haskell.org/D3633
      (cherry picked from commit dcdc3916)
    • Ben Gamari's avatar
      users-guide: Document multi-line DEPRECATED pragmas · d8794aa5
      Ben Gamari authored
      Fixes #13791.
      [skip ci]
      Test Plan: Read it
      Reviewers: austin
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13791
      Differential Revision: https://phabricator.haskell.org/D3639
      (cherry picked from commit 8f726089)
    • Ben Gamari's avatar
      Bump time submodule to · a5e045af
      Ben Gamari authored
    • Simon Marlow's avatar
      Fix a lost-wakeup bug in BLACKHOLE handling (#13751) · 62a4f066
      Simon Marlow authored
      The problem occurred when
      * Threads A & B evaluate the same thunk
      * Thread A context-switches, so the thunk gets blackholed
      * Thread C enters the blackhole, creates a BLOCKING_QUEUE attached to
        the blackhole and thread A's `tso->bq` queue
      * Thread B updates the blackhole with a value, overwriting the BLOCKING_QUEUE
      * We GC, replacing A's update frame with stg_enter_checkbh
      * Throw an exception in A, which ignores the stg_enter_checkbh frame
      Now we have C blocked on A's tso->bq queue, but we forgot to check the
      queue because the stg_enter_checkbh frame has been thrown away by the
      The solution and alternative designs are discussed in Note [upd-black-hole].
      This also exposed a bug in the interpreter, whereby we were sometimes
      context-switching without calling `threadPaused()`.  I've fixed this
      and added some Notes.
      Test Plan:
      * `cd testsuite/tests/concurrent && make slow`
      * validate
      Reviewers: niteria, bgamari, austin, erikd
      Reviewed By: erikd
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13751
      Differential Revision: https://phabricator.haskell.org/D3630
      (cherry picked from commit 59847290)
    • Ben Gamari's avatar
      build.mk: Disable -g by default · 1767f542
      Ben Gamari authored
    • Ben Gamari's avatar
      Bump haddock submodule · 5eb05459
      Ben Gamari authored
  5. 15 Jun, 2017 3 commits
    • Simon Peyton Jones's avatar
      Stop the specialiser generating loopy code · a7a1d7fd
      Simon Peyton Jones authored
      This patch fixes a bad bug in the specialiser, which showed up as
      Trac #13429.  When specialising an imported DFun, the specialiser could
      generate a recusive loop where none existed in the original program.
      It's all rather tricky, and I've documented it at some length in
         Note [Avoiding loops]
      We'd encoutered exactly this before (Trac #3591) but I had failed
      to realise that the very same thing could happen for /imported/
      I did quite a bit of refactoring.
      The compiler seems to get a tiny bit faster on
      but almost all the gain had occurred before now; this
      patch just pushed it over the line.
      (cherry picked from commit 2b74bd9d)
    • Simon Peyton Jones's avatar
      Make CallInfo into a data type with fields · 24f9d075
      Simon Peyton Jones authored
      Simple refactor, no change in behaviour
      (cherry picked from commit cb5ca5f3)
    • Ben Gamari's avatar
      testsuite: Bump T9675 allocations · b0b330e9
      Ben Gamari authored
  6. 14 Jun, 2017 4 commits
  7. 23 May, 2017 6 commits
  8. 22 May, 2017 3 commits
    • Rufflewind's avatar
      Add "header" to GHC_COLORS · c0b82c38
      Rufflewind authored
      Add "header" to GHC_COLORS and allow colors to be inherited from the
      Test Plan: validate
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #13718
      Differential Revision: https://phabricator.haskell.org/D3599
      (cherry picked from commit 139ef04b)
    • Herbert Valerio Riedel's avatar
      Handle file targets in missing home modules warning · 72eade6d
      Herbert Valerio Riedel authored
      When main module is listed on command line as a file, we should not
      issue a warning about it. See Trac #13727
      Reviewers: austin, bgamari, Yuras
      Reviewed By: bgamari, Yuras
      Subscribers: 23Skidoo, rwbarton, thomie
      GHC Trac Issues: #13727
      Differential Revision: https://phabricator.haskell.org/D3598
      (cherry picked from commit dac49bdc)
    • Kubo Kovac's avatar
      fix a memory leak in osNumaMask · 2a5f7b3c
      Kubo Kovac authored
      got an error when using asan:
      ==1866689==ERROR: LeakSanitizer: detected memory leaks
      Direct leak of 16 byte(s) in 1 object(s) allocated from:
          #0 0x10640568 in malloc ??:?
          #1 0x154d867e in numa_bitmask_alloc .../numactl-2.0.8/libnuma_nosymve r.c:204
          #2 0x154d867e in numa_allocate_nodemask .../numactl-2.0.8/libnuma_nosymve r.c:724
          #3 0x154d867e in numa_get_mems_allowed .../numactl-2.0.8/libnuma_nosymve r.c:1141
          #4 0x10b54a45 in osNumaMask ...ghc-8.0.2/rts/posix/OSMem.c:59 8
      Test Plan: compile, validate
      Reviewers: simonmar, niteria, austin, bgamari, erikd
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3537
      (cherry picked from commit 83ee930f)