1. 19 Jun, 2018 2 commits
  2. 18 Jun, 2018 5 commits
    • Richard Eisenberg's avatar
      Fix typo in comment only · de692fd5
      Richard Eisenberg authored
      [skip ci]
      de692fd5
    • Gabor Greif's avatar
      Typofixes in docs and comments [ci skip] · 6ac8a72f
      Gabor Greif authored
      6ac8a72f
    • Simon Peyton Jones's avatar
      Fix typechecking of kind signatures · 30b029be
      Simon Peyton Jones authored
      When typechecking a type like
         Maybe (a :: <kind-sig>)
      with a kind signature, we were using tc_lhs_kind to
      typecheck the signature.  But that's utterly wrong; we
      need the signature to be fully solid (non unresolved
      equalities) before using it.  In the case of Trac #14904
      we went on to instantiate the kind signature, when it
      still had embedded unsolved constraints.  This tripped
      the level-checking assertion when unifying a variable.
      
      The fix looks pretty easy to me: just call tcLHsKind
      instead.  I had to add KindSigCtxt to
      30b029be
    • Simon Peyton Jones's avatar
      Two small refactorings · 850ae8c5
      Simon Peyton Jones authored
      * Define Type.substTyVarBndrs, and use it
      
      * Rename substTyVarBndrCallback to substTyVarBndrUsing,
        and other analogous higher order functions.  I kept
        stumbling over the name.
      850ae8c5
    • Simon Peyton Jones's avatar
      Fix an infinite loop in niFixTCvSubst · d6216443
      Simon Peyton Jones authored
      Trac #14164 made GHC loop, a pretty serious error. It turned
      out that Unify.niFixTCvSubst was looping forever, because we
      had a substitution like
          a :-> ....(b :: (c :: d))....
          d :-> ...
      We correctly recognised that d was free in the range of the
      substitution, but then failed to apply it "deeeply enough"
      to the range of the substiuttion, so d was /still/ free in
      the range, and we kept on going.
      
      Trac #9106 was caused by a similar problem, but alas my
      fix to Trac #9106 was inadequate when the offending type
      variable is more deeply buried.  Urk.
      
      This time I think I've fixed it!  It's much more subtle
      than I though, and it took most of a long train journey
      to figure it out.  I wrote a long note to explain:
      Note [Finding the substitution fixpoint]
      d6216443
  3. 17 Jun, 2018 17 commits
    • Ryan Scott's avatar
      Remove accidentally checked-in T14845.stderr · 50d7b2ac
      Ryan Scott authored
      This was a stderr file for a WIP test in D4728. I ended up removing
      the test, but forgot to remove the stderr file.
      50d7b2ac
    • Vladislav Zavialov's avatar
      Add -Werror=compat · 04e9fe5c
      Vladislav Zavialov authored
      Add a flag `-Werror=compat` to GHC which has the effect of `-Werror=x
      -Werror=y ...`, where `x, y, ...` are warnings from the `-Wcompat`
      option group.
      
      Test Plan: ./validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15278
      
      Differential Revision: https://phabricator.haskell.org/D4860
      04e9fe5c
    • Ömer Sinan Ağacan's avatar
      Use __FILE__ for Cmm assertion locations, fix #8619 · 008ea12d
      Ömer Sinan Ağacan authored
      It seems like we currently support string literals in Cmm, so we can use
      __LINE__ CPP macro in assertion macros. This improves error messages
      that previously looked like
      
          ASSERTION FAILED: file (null), line 1302
      
      (null) part now shows the actual file name.
      
      Also inline some single-use string literals in PrimOps.cmm.
      
      Reviewers: bgamari, simonmar, erikd
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4862
      008ea12d
    • Sergei Trofimovich's avatar
      UNREG: fix CmmRegOff large offset handling on W64 platforms · b8e34992
      Sergei Trofimovich authored
      Gabor noticed C warning when building unregisterised
      64-bit compiler on GHC.Integer.Types (from integer-simple).
      
      Minimised example with a warning:
      
      ```haskell
      {-# LANGUAGE MagicHash #-}
      {-# LANGUAGE NoImplicitPrelude #-}
      {-# OPTIONS_GHC -Wall #-}
      
      module M (bug) where
      
      import GHC.Prim (Word#, minusWord#, ltWord#)
      import GHC.Types (isTrue#)
      
      -- assume Word = Word64
      bug :: Word# -> Word#
      bug x = if isTrue# (x `ltWord#` 0x8000000000000000##) then 0##
              else x `minusWord#` 0x8000000000000000##
      ```
      
      ```
      $ LANG=C x86_64-UNREG-linux-gnu-ghc -O1 -c M.hs -fforce-recomp
      /tmp/ghc30219_0/ghc_1.hc: In function 'M_bug_entry':
      
      /tmp/ghc30219_0/ghc_1.hc:20:14: error:
           warning: integer constant is so large that it is unsigned
      ```
      
      It's caused by limited handling of integer literals in CmmRegOff.
      This change switches to use standard integer literal pretty-printer.
      
      C code before the change:
      
      ```c
      FN_(M_bug_entry) {
      W_ _sAg;
      _cAr:
      _sAg = *Sp;
      switch ((W_)(_sAg < 0x8000000000000000UL)) {
      case 0x1UL: goto _cAq;
      default: goto _cAp;
      }
      _cAp:
      R1.w = _sAg+-9223372036854775808;
      // ...
      ```
      
      C code after the change:
      
      ```c
      FN_(M_bug_entry) {
      W_ _sAg;
      _cAr:
      _sAg = *Sp;
      switch ((W_)(_sAg < 0x8000000000000000UL)) {
      case 0x1UL: goto _cAq;
      default: goto _cAp;
      }
      _cAp:
      R1.w = _sAg+(-0x8000000000000000UL);
      ```
      
      URL: https://mail.haskell.org/pipermail/ghc-devs/2018-June/015875.html
      Reported-by: Gabor Greif
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      
      Test Plan: test generated code on unregisterised mips64 and amd64
      
      Reviewers: simonmar, ggreif, bgamari
      
      Reviewed By: ggreif, bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4856
      b8e34992
    • Ryan Scott's avatar
      Provide a better error message for unpromotable data constructor contexts · c6375411
      Ryan Scott authored
      Trac #14845 brought to light a corner case where a data
      constructor could not be promoted (even with `-XTypeInType`) due to
      an unpromotable constraint in its context. However, the error message
      was less than helpful, so this patch adds an additional check to
      `tcTyVar` catch unpromotable data constructors like these //before//
      they're promoted, and to give a sensible error message in such cases.
      
      Test Plan: make test TEST="T13895 T14845"
      
      Reviewers: simonpj, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #13895, #14845
      
      Differential Revision: https://phabricator.haskell.org/D4728
      c6375411
    • Azel's avatar
      Improve documentation of Eq, Ord instances for Float and Double · 793902e6
      Azel authored
      Reviewers: sjakobi, dfeuer, bgamari, hvr
      
      Reviewed By: sjakobi, bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #15078
      
      Differential Revision: https://phabricator.haskell.org/D4736
      793902e6
    • sgillespie's avatar
      Improve error message when importing an unusable package · df0f148f
      sgillespie authored
      If a module cannot be found because it is ignored or from an unusable
      package, report this to the user and the reason it is unusable.
      
      Currently, GHC displays the standard "Cannot find module error". For
      example:
      
      ```
      <no location info>: error:
          Could not find module ‘Control.Monad.Random’
          Perhaps you meant
            Control.Monad.Reader (from mtl-2.2.2)
            Control.Monad.Cont (from mtl-2.2.2)
            Control.Monad.Error (from mtl-2.2.2)
      ```
      
      GHC does, however, indicate unusable/ignored packages with the -v flag:
      
      ```
      package MonadRandom-0.5.1-1421RgpXdhC8e8UI7D3emA is unusable due to
      missing dependencies:
        fail-4.9.0.0-BAHmj60kS5K7NVhhKpm9J5
      ```
      
      With this change, I took that message and added it to the output of the
      "Cannot find module" message.
      
      Reviewers: bgamari, dfeuer
      
      Reviewed By: bgamari
      
      Subscribers: Phyx, dfeuer, rwbarton, thomie, carter
      
      GHC Trac Issues: #4806
      
      Differential Revision: https://phabricator.haskell.org/D4783
      df0f148f
    • Adam Gundry's avatar
      Handle DuplicateRecordFields correctly in filterImports (fixes #14487) · ccd8ce40
      Adam Gundry authored
      filterImports needed a small adjustment to correctly handle record field
      definitions arising from modules with DuplicateRecordFields enabled.
      
      Previously hiding fields was not possible with DuplicateRecordFields enabled.
      
      Test Plan: new test rename/should_compile/T14487
      
      Reviewers: bgamari
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #14487
      
      Differential Revision: https://phabricator.haskell.org/D4805
      ccd8ce40
    • Ben Gamari's avatar
      9897440e
    • Ben Gamari's avatar
      testsuite: Mark T3001-2 as broken on 32-bit platforms · 749bc1a0
      Ben Gamari authored
      Due to #15063.
      749bc1a0
    • Ben Gamari's avatar
      d1c7239c
    • Ben Gamari's avatar
      Bump process submodule · 0db05ad9
      Ben Gamari authored
      0db05ad9
    • Ben Gamari's avatar
      Revert "rts: Use .cfi_{start|end}proc directives" · 76b343f5
      Ben Gamari authored
      This reverts commit 86210b23.
      76b343f5
    • Vladislav Zavialov's avatar
      Warn about implicit kind variables with -Wcompat · 8df24474
      Vladislav Zavialov authored
      According to an accepted proposal
      https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/002
      4-no-kind-vars.rst
      
          With -Wcompat, warn if a kind variable is brought into scope
          implicitly in a type with an explicit forall. This applies to type
          signatures and to other contexts that allow a forall with the
          forall-or-nothing rule in effect (for example, class instances).
      
      Test Plan: Validate
      
      Reviewers: goldfire, hvr, bgamari, RyanGlScott
      
      Reviewed By: goldfire
      
      Subscribers: RyanGlScott, rwbarton, thomie, carter
      
      GHC Trac Issues: #15264
      
      Differential Revision: https://phabricator.haskell.org/D4834
      8df24474
    • Ben Gamari's avatar
      base: Add default implementation for Data.Bits.bitSize · 4cd55218
      Ben Gamari authored
      Fixes #12970 and will provide a reasonable migration path for the
      eventual remove of this function.
      
      Test Plan: Validate
      
      Reviewers: ekmett, hvr
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #12970
      
      Differential Revision: https://phabricator.haskell.org/D4857
      4cd55218
    • Ben Gamari's avatar
      Revert "Amend configure script to support lndir build tree" · d55035f5
      Ben Gamari authored
      This appears to inexplicably break the OS X build, which fails with:
      ```
      make[1]: *** No rule to make target `utils/unlit/fs.c', needed by
               `utils/unlit/dist/build/.depend.c_asm'.  Stop.
      make[1]: *** Waiting for unfinished jobs....
      make: *** [all] Error 2
      ```
      
      This reverts commit 8ee9c574.
      d55035f5
    • Sylvain Henry's avatar
      Enhanced constant folding · 60e4bb4d
      Sylvain Henry authored
      Until now GHC only supported basic constant folding (lit op lit, expr op
      0, etc.).
      
      This patch uses laws of +/-/* (associativity, commutativity,
      distributivity) to support some constant folding into nested
      expressions.
      
      Examples of new transformations:
      
         - simple nesting: (10 + x) + 10 becomes 20 + x
         - deep nesting: 5 + x + (y + (z + (t + 5))) becomes 10 + (x + (y + (z + t)))
         - distribution: (5 + x) * 6 becomes 30 + 6*x
         - simple factorization: 5 + x + (x + (x + (x + 5))) becomes 10 + (4 *x)
         - siblings: (5 + 4*x) - (3*x + 2) becomes 3 + x
      
      Test Plan: validate
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      GHC Trac Issues: #9136
      
      Differential Revision: https://phabricator.haskell.org/D2858
      
      (cherry picked from commit fea04def)
      60e4bb4d
  4. 16 Jun, 2018 11 commits
  5. 15 Jun, 2018 5 commits