1. 22 Jun, 2018 6 commits
    • Andreas Klebinger's avatar
      Explain why opt-cmm is not dumped by ddump-cmm-verbose. · 391b0caf
      Andreas Klebinger authored
      We just update the docs to reflect the state of affairs.
      opt-cmm is run by the NCG backend so not always run.
      ddump-cmm-verbose only dumps passes of the cmm
      pipeline so it's not included there. [skip-ci]
      Test Plan: doc change
      Reviewers: bgamari
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4879
    • Alan Zimmerman's avatar
      TTG for IPBind had wrong extension name · 5f06cf6b
      Alan Zimmerman authored
      The standard[1] for extension naming is to use the XC prefix for the
      internal extension points, rather than for a new constructor.
      This is violated for IPBind, having
          data IPBind id
            = IPBind
                  (XIPBind id)
                  (Either (Located HsIPName) (IdP id))
                  (LHsExpr id)
            | XCIPBind (XXIPBind id)
      Swap the usage of XIPBind and XCIPBind
      [1] https://ghc.haskell.org/trac/ghc/wiki/ImplementingTreesThatGrow#Namingconventions
      Closes #15302
    • Simon Peyton Jones's avatar
    • Simon Peyton Jones's avatar
      Remove unnecessary call to checkReductionDepth · d5459a33
      Simon Peyton Jones authored
      We call checkReductionDepth in chooseInstance, so there's no
      need to call it in selectNextWorkItem too
    • Simon Peyton Jones's avatar
      Refactor try_solve_fromInstance in shortCutSolver · e0653697
      Simon Peyton Jones authored
      This patch just removes the CtLoc parameter from trySolveFromInstance,
      since it can just as easily (and more uniformly) be gotten from the
      CtEvidence it is trying to solve.
    • Simon Peyton Jones's avatar
      Instances in no-evidence implications · 32eb4199
      Simon Peyton Jones authored
      Trac #15290 showed that it's possible that we might attempt to use a
      quantified constraint to solve an equality in a situation where we
      don't have anywhere to put the evidence bindings.  This made GHC crash.
      This patch stops the crash, but still rejects the pogram.  See
      Note [Instances in no-evidence implications] in TcInteract.
      Finding this bug revealed another lurking bug:
      * An infelicity in the treatment of superclasses -- we were expanding
        them locally at the leaves, rather than at their binding site; see
        (3a) in Note [The superclass story].
        As a consequence, TcRnTypes.superclassesMightHelp must look inside
      In more detail:
      * Stop the crash, by making TcInteract.chooseInstance test for
        the no-evidence-bindings case.  In that case we simply don't
        use the instance.  This entailed a slight change to the type
        of chooseInstance.
      * Make TcSMonad.getPendingScDicts (now renamed getPendingGivenScs)
        return only Givens from the /current level/; and make
        TcRnTypes.superClassesMightHelp look inside implications.
      * Refactor the simpl_loop and superclass-expansion stuff in
        TcSimplify.  The logic is much easier to understand now, and
        has less duplication.
  2. 21 Jun, 2018 2 commits
  3. 20 Jun, 2018 15 commits
  4. 19 Jun, 2018 6 commits
  5. 18 Jun, 2018 5 commits
    • Richard Eisenberg's avatar
      Fix typo in comment only · de692fd5
      Richard Eisenberg authored
      [skip ci]
    • Gabor Greif's avatar
      Typofixes in docs and comments [ci skip] · 6ac8a72f
      Gabor Greif authored
    • 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
    • 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.
    • 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]
  6. 17 Jun, 2018 6 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.
    • 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
    • Ö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
    • 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:
      {-# 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:
      FN_(M_bug_entry) {
      W_ _sAg;
      _sAg = *Sp;
      switch ((W_)(_sAg < 0x8000000000000000UL)) {
      case 0x1UL: goto _cAq;
      default: goto _cAp;
      R1.w = _sAg+-9223372036854775808;
      // ...
      C code after the change:
      FN_(M_bug_entry) {
      W_ _sAg;
      _sAg = *Sp;
      switch ((W_)(_sAg < 0x8000000000000000UL)) {
      case 0x1UL: goto _cAq;
      default: goto _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
    • 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
    • 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