1. 21 May, 2018 1 commit
  2. 20 May, 2018 8 commits
    • Ben Gamari's avatar
      daa4de1f
    • Ben Gamari's avatar
      Set RELEASE=YES, version 8.4.3 · c70d515e
      Ben Gamari authored
      c70d515e
    • Simon Marlow's avatar
      storageAddCapabilities: fix bug in updating nursery pointers · 31d38067
      Simon Marlow authored
      Summary:
      We were unconditionally updating the nursery pointers to be
      `nurseries[cap->no]`, but when using nursery chunks this might be
      wrong. This manifested as a later assertion failure in allocate().
      
      Test Plan: new test case
      
      Reviewers: bgamari, niteria, erikd
      
      Subscribers: thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4649
      
      (cherry picked from commit 4cb5595e)
      31d38067
    • Herbert Valerio Riedel's avatar
      Emit info-level log message when package envs are loaded · de3ade60
      Herbert Valerio Riedel authored
      A common complaint with the new package environment files feature is
      that it's not obvious when package environments have been picked up.
      This patch applies the same strategy that was already used for `.ghci` files
      (which exhibit similar potential for confusion, c.f. #11389) to package
      environment files.
      
      For instance, this new notification looks like below for a GHCi invocation which
      loads both, a GHCi configuration as well as a package environment:
      
        GHCi, version 8.5.20180512: http://www.haskell.org/ghc/  :? for help
        Loaded package environment from /tmp/parsec-3.1.13.0/.ghc.environment.x86_64-linux-8.5.20180512
        Loaded GHCi configuration from /home/hvr/.ghci
        Prelude>
      
      Addresses #15145
      
      Reviewed By: bgamari, angerman
      
      GHC Trac Issues: #15145
      
      Differential Revision: https://phabricator.haskell.org/D4689
      
      (cherry picked from commit 00049e2d)
      de3ade60
    • Bertram Felgenhauer's avatar
      Compute DW_FORM_block length correctly; also fixes #15068 · 56812d6f
      Bertram Felgenhauer authored
      Before this patch, the pprUnwindwExpr function computed the length of
      by the following assembly fragment:
      
      	.uleb128 1f-.-1
      	<expression data>
      1:
      
      That is, to compute the length, it takes the difference of the label 1
      and the address of the .uleb128 directive, and subtracts 1.
      
      In #15068 it was reported that `as` from binutils 4.30 has trouble with
      evaluating the `.` part of the expression. However, there is actually a
      problem with the expression, if the length of the data ever becomes
      larger than 128: In that case, the .uleb128 directive will emit more
      than 1 byte, and the computed length will be wrong.
      
      The present patch changes the assembly fragment to use two labels,
      which fixes both these problems.
      
      	.uleb128 2f-1f
      1:
      	<expression data>
      2:
      
      Test Plan: validate
      
      Reviewers: bgamari, osa1
      
      Reviewed By: bgamari
      
      Subscribers: thomie, carter
      
      GHC Trac Issues: #15068
      
      Differential Revision: https://phabricator.haskell.org/D4654
      
      (cherry picked from commit 358b5080)
      56812d6f
    • Sergei Trofimovich's avatar
      rts: export new absentSumFieldError from base · e4e61f77
      Sergei Trofimovich authored
      commit b2ff5dde "Fix #15038"
      added new stable closure 'absentSumFieldError_closure' to
      base package. This closure is used in rts package.
      
      Unfortunately the symbol was not explicitly exported and build
      failed on windows as:
      
      ```
      "inplace/bin/ghc-stage1" -o ...hsc2hs.exe ...
      rts/dist/build/libHSrts.a(RtsStartup.o): In function `hs_init_ghc':
      
      rts/RtsStartup.c:272:0: error:
           undefined reference to `base_ControlziExceptionziBase_absentSumFieldError_closure'
          |
      272 |     getStablePtr((StgPtr)absentSumFieldError_closure);
          | ^
      
      ```
      
      This change adds 'absentSumFieldError_closure' to explicit export
      into libHSbase.def.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      (cherry picked from commit 79bbb23f)
      e4e61f77
    • Ömer Sinan Ağacan's avatar
      Fix #15038 · 64ecfc37
      Ömer Sinan Ağacan authored
      We introduce a new Id for unused pointer values in unboxed sums that is
      not CAFFY. Because the Id is not CAFFY it doesn't make non-CAFFY
      definitions CAFFY, fixing #15038.
      
      To make sure anything referenced by the new id will be retained we get a
      stable pointer to in on RTS startup.
      
      Test Plan: Passes validate
      
      Reviewers: simonmar, simonpj, hvr, bgamari, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15038
      
      Differential Revision: https://phabricator.haskell.org/D4680
      
      (cherry picked from commit b2ff5dde)
      64ecfc37
    • Ben Gamari's avatar
      rts: Fix compaction of SmallMutArrPtrs · 0d40fd75
      Ben Gamari authored
      This was blatantly wrong due to copy-paste blindness:
      
       * labels were shadowed, which GHC doesn't warn about(!), resulting in
         plainly wrong behavior
       * the sharing check was omitted
       * the wrong closure layout was being used
      
      Moreover, the test wasn't being run due to its primitive dependency, so
      I didn't even notice. Sillyness.
      
      Test Plan: install `primitive`, `make test TEST=compact_small_array`
      
      Reviewers: simonmar, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #13857.
      
      Differential Revision: https://phabricator.haskell.org/D4702
      
      (cherry picked from commit 12deb9a9)
      0d40fd75
  3. 13 May, 2018 1 commit
  4. 02 May, 2018 1 commit
  5. 20 Apr, 2018 1 commit
  6. 19 Apr, 2018 1 commit
  7. 17 Apr, 2018 3 commits
  8. 16 Apr, 2018 1 commit
  9. 14 Apr, 2018 5 commits
    • Simon Peyton Jones's avatar
      SpecConstr: accommodate casts in value arguments · 6ed694d7
      Simon Peyton Jones authored
      This commit:
      
        commit fb050a33
        Author: Simon Peyton Jones <simonpj@microsoft.com>
        Date:   Thu Oct 12 11:00:19 2017 +0100
      
        Do not bind coercion variables in SpecConstr rules
      
      arranged to reject any SpecConstr call pattern that mentioned
      a coercion in the pattern.
      
      There was a good reason for that
      -- see Note [SpecConstr and casts] --
      but I didn't realise how important it was to accept patterns
      that mention casts in /terms/.  Trac #14936 showed this up.
      
      This patch just narrows the restriction to discard only
      the cases where the coercion is mentioned only in types.
      Fortunately that was pretty easy to do.
      
      (cherry picked from commit 5ab8094e)
      6ed694d7
    • Joachim Breitner's avatar
      In Exitify, zap idInfo of abstracted variables (fixes #15005) · 2f5b97c3
      Joachim Breitner authored
      as helpfully outlined by SPJ.
      
      This commit copies a small bit code from `SetLevels` which could
      reasonably be put in `Id` as `zapAllIdinfo`; I did not do this to make
      merging this commmit into `ghc-8.4` easier.
      
      If this commit gets merged, then presumably after commit
      3f59d380 (test case) and
      ae0cff0a (other fixes to Exitify.hs).
      
      Differential Revision: https://phabricator.haskell.org/D4582
      
      (cherry picked from commit 3cfb12d8)
      2f5b97c3
    • Joachim Breitner's avatar
      Add test case for #15005 · e1071f6e
      Joachim Breitner authored
      this succeeds on `master` right now, but I confirmed that it fails on
      ghc-8.4.1-release.
      
      (cherry picked from commit 3f59d380)
      e1071f6e
    • Joachim Breitner's avatar
      CSE: Walk past join point lambdas (#15002) · 4edcef78
      Joachim Breitner authored
      As the CSE transformation traverses the syntax tree, it needs to go past
      the lambdas of a join point, and only look for CSE opportunities inside,
      as a join point’s lambdas must be preserved. Simple fix; comes with a
      Note and a test case.
      
      Thanks to Ryan Scott for an excellently minimized test case, and for
      bisecting GHC.
      
      Differential Revision: https://phabricator.haskell.org/D4572
      
      (cherry picked from commit ae0cff0a)
      4edcef78
    • Ryan Scott's avatar
      Correct FixIOException's @since annotation retroactively · 8147fa32
      Ryan Scott authored
      Summary:
      In D4113, a `FixIOException` data type was added with a
      `@since TODO` annotation, but it seems that `TODO` made it out into
      `base-4.11` itself. I've (retroactively) fixed this and added an
      entry to the `base-4.11` entry in the `changelog`.
      
      Test Plan: Read it
      
      Reviewers: dfeuer, hvr, bgamari
      
      Reviewed By: dfeuer
      
      Subscribers: thomie, carter
      
      GHC Trac Issues: #14356, #15025
      
      Differential Revision: https://phabricator.haskell.org/D4578
      
      (cherry picked from commit ce27c7d5)
      8147fa32
  10. 13 Apr, 2018 3 commits
  11. 11 Apr, 2018 1 commit
    • Ben Gamari's avatar
      rts/RetainerProfile: Handle BLOCKING_QUEUES · 0ec1bd64
      Ben Gamari authored
      push() considers BLOCKING_QUEUES to be an invalid closure type which
      should never be present on the stack. However, retainClosure made no
      accomodation for this and ended up pushing such a closure. This lead
      to #14947.
      
      Test Plan: Validate
      
      Reviewers: simonmar, erikd
      
      Reviewed By: simonmar
      
      Subscribers: thomie, carter, RyanGlScott
      
      GHC Trac Issues: #14947
      
      Differential Revision: https://phabricator.haskell.org/D4538
      
      (cherry picked from commit d5f6d7a0)
      0ec1bd64
  12. 29 Mar, 2018 4 commits
    • Ben Gamari's avatar
      Bump haddock submodule again · 6d7eecff
      Ben Gamari authored
      6d7eecff
    • Ryan Scott's avatar
      Don't permit data types with return kind Constraint · b5c50241
      Ryan Scott authored
      Previously, GHC allowed all of the following:
      
      ```lang=haskell
      data Foo1 :: Constraint
      data family Foo2 :: Constraint
      data family Foo3 :: k
      data instance Foo3 :: Constraint
      ```
      
      Yikes! This is because GHC was confusing `Type` with `Constraint`
      due to careless use of the `isLiftedTypeKind` function. To respect
      this distinction, I swapped `isLiftedTypeKind` out for
      `tcIsStarKind`—which does respect this distinction—in the right
      places.
      
      Test Plan: make test TEST="T14048a T14048b T14048c"
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: goldfire, rwbarton, thomie, carter
      
      GHC Trac Issues: #14048
      
      Differential Revision: https://phabricator.haskell.org/D4479
      
      (cherry picked from commit f748c529)
      b5c50241
    • Simon Peyton Jones's avatar
      Fix tcDataKindSig · 02aa02f1
      Simon Peyton Jones authored
      This patch fixes an outright bug in tcDataKindSig, shown up in Trac
      of a data type declaration.  See Note [TyConBinders for the result kind
      signature of a data type]
      
      I also took the opportunity to elminate the DataKindCheck argument
      and data type from tcDataKindSig, instead moving the check to the
      call site, which is easier to understand.
      
      (cherry picked from commit 68149452)
      02aa02f1
    • Ömer Sinan Ağacan's avatar
      Revert "GHCi: Don't remove shadowed bindings from typechecker scope." · fbc4ebaf
      Ömer Sinan Ağacan authored
      This reverts commit 59d7ee53 and enables
      the test for #14052.
      
      (See #14052 for the discussion)
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14052
      
      Differential Revision: https://phabricator.haskell.org/D4478
      
      (cherry picked from commit 98c7749c)
      fbc4ebaf
  13. 28 Mar, 2018 4 commits
  14. 26 Mar, 2018 6 commits
    • Simon Peyton Jones's avatar
      Fix a nasty bug in the pure unifier · 1132ec68
      Simon Peyton Jones authored
      The pure unifier was building an infinite type, through a defective
      occurs check.  So GHC went into an infinite loop.
      
      Reason: we were neglecting the 'kco' part of the type, which
      'unify_ty' maintains.  Yikes.
      
      The fix is easy.  I refactored a bit to make it harder to
      go wrong in future.
      
      (cherry picked from commit e99fdf77)
      1132ec68
    • Ryan Scott's avatar
      Fix two pernicious bugs in DeriveAnyClass · d8dbe293
      Ryan Scott authored
      The way GHC was handling `DeriveAnyClass` was subtly wrong
      in two notable ways:
      
      * In `inferConstraintsDAC`, we were //always// bumping the `TcLevel`
        of newly created unification variables, under the assumption that
        we would always place those unification variables inside an
        implication constraint. But #14932 showed precisely the scenario
        where we had `DeriveAnyClass` //without// any of the generated
        constraints being used inside an implication, which made GHC
        incorrectly believe the unification variables were untouchable.
      * Even worse, we were using the generated unification variables from
        `inferConstraintsDAC` in every single iteration of `simplifyDeriv`.
        In #14933, however, we have a scenario where we fill in a
        unification variable with a skolem in one iteration, discard it,
        proceed on to another iteration, use the same unification variable
        (still filled in with the old skolem), and try to unify it with
        a //new// skolem! This results in an utter disaster.
      
      The root of both these problems is `inferConstraintsDAC`. This patch
      fixes the issue by no longer generating unification variables
      directly in `inferConstraintsDAC`. Instead, we store the original
      variables from a generic default type signature in `to_metas`, a new
      field of `ThetaOrigin`, and in each iteration of `simplifyDeriv`, we
      generate fresh meta tyvars (avoiding the second issue). Moreover,
      this allows us to more carefully fine-tune the `TcLevel` under which
      we create these meta tyvars, fixing the first issue.
      
      Test Plan: make test TEST="T14932 T14933"
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14932, #14933
      
      Differential Revision: https://phabricator.haskell.org/D4507
      
      (cherry picked from commit 98930426)
      d8dbe293
    • Tao He's avatar
      UnboxedTuples can't be used as constraints · 43f63a6b
      Tao He authored
      Fixes #14740.
      
      Test Plan: make test TEST="14740"
      
      Reviewers: bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #14740
      
      Differential Revision: https://phabricator.haskell.org/D4359
      
      (cherry picked from commit ced9fbd3)
      43f63a6b
    • Ryan Scott's avatar
      Fix #14934 by including axSub0R in typeNatCoAxiomRules · e04aaf75
      Ryan Scott authored
      For some reason, `axSub0R` was left out of `typeNatCoAxiomRules` in
      `TcTypeNats`, which led to disaster when trying to look up `Sub0R` from
      an interface file, as demonstrated in #14934.
      
      The fix is simple—just add `axSub0R` to that list. To help prevent
      an issue like this happening in the future, I added a
      `Note [Adding built-in type families]` to `TcTypeNats`, which
      contains a walkthrough of all the definitions in `TcTypeNats` you
      need to update when adding a new built-in type family.
      
      Test Plan: make test TEST=T14934
      
      Reviewers: bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #14934
      
      Differential Revision: https://phabricator.haskell.org/D4508
      
      (cherry picked from commit c3aea396)
      e04aaf75
    • Simon Peyton Jones's avatar
      Fix seq# case of exprOkForSpeculation · ac1ade1a
      Simon Peyton Jones authored
      This subtle patch fixes Trac #5129 (again; comment:20
      and following).
      
      I took the opportunity to document seq# properly; see
      Note [seq# magic] in PrelRules, and Note [seq# and expr_ok]
      in CoreUtils.
      
      (cherry picked from commit abaf43d9)
      ac1ade1a
    • Simon Peyton Jones's avatar
      Fix over-eager constant folding in bitInteger · 3c6a0578
      Simon Peyton Jones authored
      The RULE for bitInteger was trying to constant-fold
      
          bitInteger 9223372036854775807#
      
      which meant constructing a gigantic Integer at compile
      time.  Very bad idea!  Easily fixed.
      
      Fixes Trac #14959, #14962.
      
      (cherry picked from commit efc844f5)
      3c6a0578