This project is mirrored from https://gitlab.haskell.org/ghc/ghc.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Last successful update .
  1. 17 Jun, 2018 15 commits
    • Ö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
      testsuite: Mark print022 as broken on 32-bit platforms · 9897440e
      Ben Gamari authored
      Due to #15061.
      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
      configure: Fail when bootstrapping with GHC 8.2.1 · d1c7239c
      Ben Gamari authored
      See #15281
      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
  2. 16 Jun, 2018 11 commits
  3. 15 Jun, 2018 14 commits
    • Sylvain Henry's avatar
      Built-in Natural literals in Core · fe770c21
      Sylvain Henry authored
      Add support for built-in Natural literals in Core.
      
      - Replace MachInt,MachWord, LitInteger, etc. with a single LitNumber
        constructor with a LitNumType field
      - Support built-in Natural literals
      - Add desugar warning for negative literals
      - Move Maybe(..) from GHC.Base to GHC.Maybe for module dependency
        reasons
      
      This patch introduces only a few rules for Natural literals (compared
      to Integer's rules). Factorization of the built-in rules for numeric
      literals will be done in another patch as this one is already big to
      review.
      
      Test Plan:
        validate
        test build with integer-simple
      
      Reviewers: hvr, bgamari, goldfire, Bodigrim, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: phadej, simonpj, RyanGlScott, carter, hsyl20, rwbarton,
      thomie
      
      GHC Trac Issues: #14170, #14465
      
      Differential Revision: https://phabricator.haskell.org/D4212
      fe770c21
    • Kirill Zaborsky's avatar
      Fix #13833: accept type literals with no FlexibleInstances · 42f3b53b
      Kirill Zaborsky authored
      Test Plan: ./validate
      
      Reviewers: bgamari, simonpj
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #13833
      
      Differential Revision: https://phabricator.haskell.org/D4823
      42f3b53b
    • Adam Gundry's avatar
      Use data con name instead of parent in lookupRecFieldOcc · 7100850e
      Adam Gundry authored
      Test Plan: new tests rename/should_compile/{T14747,T15149}
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      GHC Trac Issues: #14747, #15149
      
      Differential Revision: https://phabricator.haskell.org/D4821
      7100850e
    • Ben Gamari's avatar
      Make dtrace enabled GHC work as a bootstrap compiler on FreeBSD · 9c89ef39
      Ben Gamari authored
      Fixes #15040.
      
      Reviewers: bgamari, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4772
      9c89ef39
    • Tao He's avatar
      Add "quantified constraint" context in error message, fix #15231. · 91822e4e
      Tao He authored
      This patch adds "quantified constraint" context in error message when
      UndecidableInstances checking fails for quantified constraints.
      See Trac #15231:comment#1.
      
      This patch also pretty-prints the instance head for better error messages.
      
      Test Plan: make test TEST="T15231"
      
      Reviewers: bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, rwbarton, thomie, carter
      
      GHC Trac Issues: #15231
      
      Differential Revision: https://phabricator.haskell.org/D4819
      91822e4e
    • Matthew Pickering's avatar
      Make NameSort note into proper Note · b67b9717
      Matthew Pickering authored
      Reviewers: adamgundry, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4826
      b67b9717
    • Vladislav Zavialov's avatar
      No Unicode in Parser.y · 78f5344e
      Vladislav Zavialov authored
      Unicode characters in Parser.y cause build failures
      on systems where the locale does not support Unicode.
      
      See https://mail.haskell.org/pipermail/ghc-devs/2018-June/015874.html
      
      Test Plan: ./validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, mpickering, carter
      
      Differential Revision: https://phabricator.haskell.org/D4850
      78f5344e
    • Ben Gamari's avatar
      Bump supported LLVM version to 6.0 · e6498d67
      Ben Gamari authored
      This seems to fix a number of segmentation faults.
      e6498d67
    • Ben Gamari's avatar
      testsuite: Make T4442 compile on i386 and mark as broken · b7deeed0
      Ben Gamari authored
      There are some rather suspicious failures in the 64-bit case. See #15184 for
      details.
      b7deeed0
    • Nathan Collins's avatar
      Fix documentation for `-dth-dec-file` · 69954a12
      Nathan Collins authored
      The docs said that it took a file argument, as in
      `-dth-dec-file=<file>`, but it does not take a file argument!
      69954a12
    • Ben Gamari's avatar
      circleci: Remove systemd from Fedora nsswitch configuration · dbe5370e
      Ben Gamari authored
      Lest we end up with a non-functional user/group lookup, resulting in #15230.
      dbe5370e
    • Simon Peyton Jones's avatar
      Make better "fake tycons" in error recovery · 2f6069cc
      Simon Peyton Jones authored
      Consider (Trac #15215)
        data T a = MkT ...
        data S a = ...T...MkT....
      
      If there is an error in the definition of 'T' we add a
      "fake type constructor" to the type environment, so that we
      can continue to typecheck 'S'.  But we /were not/ adding
      a fake anything for 'MkT' and so there was an internal
      error when we met 'MkT' in the body of 'S'.
      
      The fix is to add fake tycons for all the 'implicits' of 'T'.
      This is done by mk_fake_tc in TcTyClsDecls.checkValidTyCl,
      which now returns a /list/ of TyCons rather than just one.
      
      On the way I did some refactoring:
      
      * Rename TcTyDecls.tcAddImplicits to tcAddTyConsToGblEnv
        and make it /include/ the TyCons themeselves as well
        as their implicits
      
      * Some incidental refactoring about tcRecSelBinds. The main
        thing is that I've avoided creating a HsValBinds that we
        immediately decompose.  That meant moving some deck chairs
        around.
      
      NB: The new error message for the regression test T15215
      has the opaque error "Illegal constraint in a type:", flagged
      in Trac #14845.  But that's the fault of the latter ticket.
      The fix here not to blame.
      2f6069cc
    • Simon Peyton Jones's avatar
      Fix corner case in typeKind, plus refactoring · f903e551
      Simon Peyton Jones authored
      This is a continuation of
      
          commit 9d600ea6
          Author: Simon Peyton Jones <simonpj@microsoft.com>
          Date:   Fri Jun 1 16:36:57 2018 +0100
      
              Expand type synonyms when Linting a forall
      
      That patch pointed out that there was a lurking hole in
      typeKind, where it could return an ill-scoped kind, because
      of not expanding type synonyms enough.
      
      This patch fixes it, quite nicely
      
      * Use occCheckExpand to expand those synonyms (it was always
        designed for that exact purpose), and call it from
               Type.typeKind
               CoreUtils.coreAltType
               CoreLint.lintTYpe
      
      * Consequently, move occCheckExpand from TcUnify.hs to
        Type.hs, and generalise it to take a list of type variables.
      
      I also tidied up lintType a bit.
      f903e551
    • Simon Peyton Jones's avatar
      Fix the bind-recovery type · 807ab222
      Simon Peyton Jones authored
      This patch uses (forall (a::*). a) for the type to
      use when recovering from an error in a binding.
      
      Previously (Trac #15276) we had (forall r (a :: TYPE r). a),
      which is ill-kinded.
      
      It's quite hard to provoke an error arising from this, because
      it only happens in programs that have a type error anyway,
      but in a subequent patch I make typeKind fall over if it returns
      an ill-scoped kind, and that makes ghci/scripts/T13202 crash
      without this fix.
      807ab222