1. 14 Sep, 2017 15 commits
    • Ben Gamari's avatar
      nativeGen: A few strictness fixes · ecb316c4
      Ben Gamari authored
      Test Plan: Validate
      Reviewers: austin, simonmar
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3948
    • Richard Eisenberg's avatar
      Fix #13407 by suppressing invisibles better. · 04bb8736
      Richard Eisenberg authored
      Previously, the iface-invisible-suppresser assumed that all
      invisible things are up front. Not true!
      test case: ghci/scripts/T13407
    • Richard Eisenberg's avatar
    • Richard Eisenberg's avatar
      Regression test for #12742 · c813d8c9
      Richard Eisenberg authored
      Location: dependent/should_compile/T12742
    • Richard Eisenberg's avatar
    • Simon Peyton Jones's avatar
      Add test for Trac #14232 · 93da9f95
      Simon Peyton Jones authored
    • niteria's avatar
      [RTS] Make -po work · b6b56dd1
      niteria authored
      db2a6676 added `-po` option, but
      the part that parses it was missing.
      Test Plan:
      On a simple file:
      ./inplace/bin/ghc-stage2 A.hs -prof -main-is A; ./A +RTS -P -potest
      produced test.prof file and didn't produce A.prof file.
      ./A +RTS -P
      produced A.prof file
      Reviewers: simonmar, bgamari, austin, erikd
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3946
    • Simon Peyton Jones's avatar
      Remove unused variable binding · 9e46167f
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Interim fix for a nasty type-matching bug · 9218ea60
      Simon Peyton Jones authored
      The type matcher in types/Unify.hs was producing a substitution
      that had variables from the template in its range.  Yikes!
      This patch, documented in Note [Matching in the presence of casts],
      is an interm fix.  Richard and I don't like it much, and are
      pondering a better solution (Trac #14119).
      All this came up in investigating Trac #13910. Alas this patch
      doesn't fix #13910, which still has ASSERT failures, so I have
      not yet added a test.  But the patch does fix a definite bug.
    • Simon Peyton Jones's avatar
      Refactor tcInferApps · a38acda6
      Simon Peyton Jones authored
      This is a simple refactor
      * Remove an unnecessary accumulating argument (acc_hs_apps) from
        the 'go' function
      * And put 'n' first in the same function
    • Simon Peyton Jones's avatar
      Refactor to eliminate FamTyConShape · 0390e4a0
      Simon Peyton Jones authored
      Consider this note (TcTyClsDecls)
        Note [Type-checking type patterns]
        When typechecking the patterns of a family instance declaration, we can't
        rely on using the family TyCon itself, because this is sometimes called
        from within a type-checking knot. (Specifically for closed type families.)
        The FamTyConShape gives just enough information to do the job.
      I realised that this exact purpose can be served by TcTyCons, and
      in fact rather better.  So this patch
      * Refactors FamTyConShape out of existence, replacing it with TcTyCOn
      * I also got rid Type.filterOutInvisibleTyVars, which was a very
        complex way to do something quite simple.  I replaced the calls
        with TyCon.tyConVisibleTyVars.
      No change in behaviour.
    • Simon Peyton Jones's avatar
      Tidying could cause ill-kinded types · 8bf865d3
      Simon Peyton Jones authored
      I found (Trac #14175) that the tidying we do when reporting
      type error messages could cause a well-kinded type to become
      ill-kinded. Reason: we initialised the tidy-env with a
      completely un-zonked TidyEnv accumulated in the TcLclEnv
      as we come across lexical type-varialbe bindings.
      Solution: zonk them.
      But I ended up refactoring a bit:
      * Get rid of tcl_tidy :: TidyEnv altogether
      * Instead use tcl_bndrs :: TcBinderStack
        This used to contain only Ids, but now I've added those
        lexically scoped TyVars too.
      * Change names:
           TcIdBinderStack -> TcBinderStack
           TcIdBinder      -> TcBinder
           extendTcIdBndrs -> extendTcBinderStack
      * Now tcInitTidyEnv can grab those TyVars from the
        tcl_bndrs, zonk, and tidy them.
      The only annoyance is that I had to add TcEnv.hs-boot, to
      break the recursion between the zonking code and the
      TrRnMonad functions like addErrTc that call tcInitTidyEnv.
      Tiresome, but in fact that file existed already.
    • Simon Peyton Jones's avatar
      Fix subtle bug in TcTyClsDecls.mkGADTVars · 3a27e34f
      Simon Peyton Jones authored
      This bug was revealed by Trac #14162.  In a GADT-style data-family
      instance we ended up a data constructor whose type mentioned
      an out-of-scope variable.  (This variable was in the kind of
      a variable in the kind of a variable.)
      Only Lint complained about this (actually only when the
      data constructor was injected into the bindings by CorePrep).
      So it doesn't matter much -- but it's a solid bug and might
      bite us some day.
      It took me quite a while to unravel because the test case was itself
      quite tricky.  But the fix is easy; just add a missing binding to the
      substitution we are building up.  It's in the regrettably-subtle
      mkGADTVars function.
    • Simon Peyton Jones's avatar
      More refinements to debugPprType · ab2d3d5d
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      No need to check ambiguity for visible type args · 959a623e
      Simon Peyton Jones authored
      Seems unnecesarry to me.
  2. 13 Sep, 2017 16 commits
    • Ben Gamari's avatar
      Model divergence of retry# as ThrowsExn, not Diverges · 10a1a478
      Ben Gamari authored
      The demand signature of the retry# primop previously had a Diverges
      result.  However, this caused the demand analyser to conclude that a
      program of the shape,
          catchRetry# (... >> retry#)
      would diverge. Of course, this is plainly wrong; catchRetry#'s sole
      reason to exist is to "catch" the "exception" thrown by retry#. While
      catchRetry#'s demand signature correctly had the ExnStr flag set on its
      first argument, indicating that it should catch divergence, the logic
      associated with this flag doesn't apply to Diverges results. This
      resulted in #14171.
      The solution here is to treat the divergence of retry# as an exception.
      Namely, give it a result type of ThrowsExn rather than Diverges.
      Updates stm submodule for tests.
      Test Plan: Validate with T14171
      Reviewers: simonpj, austin
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14171, #8091
      Differential Revision: https://phabricator.haskell.org/D3919
    • Ben Gamari's avatar
      rts: Add regsterCc(s)List to RTS symbols list · 4cead3c1
      Ben Gamari authored
      These are helpers added in a8da0de2 to
      register cost centres. They are invoked while loading profiled code and
      therefore need to be in the RTS's symbol list.
      Test Plan: Validate, trying starting GHCi in profiled GHC build
      Reviewers: austin, erikd, simonmar
      Subscribers: rwbarton, thomie, RyanGlScott
      Differential Revision: https://phabricator.haskell.org/D3950
    • Sibi Prabakaran's avatar
      Clarify seq documentation · 4e222203
      Sibi Prabakaran authored
      Improves the documentation by specifying that the first argument in
      seq function is evaluated to WHNF.
      Reviewers: austin, bgamari
      Reviewed By: bgamari
      Subscribers: harendra, rwbarton, thomie
      GHC Trac Issues: #14213
      Differential Revision: https://phabricator.haskell.org/D3945
    • David Feuer's avatar
      Simplify Data.Type.Equality.== · 4be195e7
      David Feuer authored
      Contrary to previous comments, we can calculate `==` for types
      in an extremely general fashion. The approach used here is actually
      the one mistakenly rejected as impossible. There will be some cases
      when the previous version was able to reduce and this one is not,
      particularly for types in `*` that are unknown, but known equal.
      However, the new behavior is much more uniform. Within the
      established framework of equality testing by pattern matching,
      it does a better job than the previous version.
      Reviewers: goldfire, austin, hvr, bgamari, RyanGlScott
      Reviewed By: RyanGlScott
      Subscribers: RyanGlScott, rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3835
    • Ben Gamari's avatar
      Better document TypeRep patterns · f9bf621c
      Ben Gamari authored
      As pointed out in #14199 these are rather non-trivial; extra
      documentation is in order.
      [skip ci]
      Test Plan: Read it
      Reviewers: dfeuer, austin, hvr
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14199
      Differential Revision: https://phabricator.haskell.org/D3943
    • Alan Zimmerman's avatar
      Option "-ddump-rn-ast" dumps imports and exports too · 2fe6f6ba
      Alan Zimmerman authored
      Previously the renamed source decls only were dumped, now the imports, exports
      and doc_hdr are too.
      Test Plan: ./validate
      Reviewers: bgamari, austin
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14197
      Differential Revision: https://phabricator.haskell.org/D3949
    • Chris Martin's avatar
      Add non-ASCII isLetter True example · 6139f7f7
      Chris Martin authored
    • Dmitry Ivanov's avatar
      Fix @since annotations in GHC.Stats · 8ff11c4e
      Dmitry Ivanov authored
    • Tao He's avatar
      Make IntPtr and WordPtr as instance of Data.Data typeclass, fix #13115 · cbd49117
      Tao He authored
      Test Plan: ./validate
      Reviewers: austin, hvr, bgamari, RyanGlScott
      Reviewed By: RyanGlScott
      Subscribers: RyanGlScott, rwbarton, thomie
      GHC Trac Issues: #13115
      Differential Revision: https://phabricator.haskell.org/D3938
    • niteria's avatar
      [RTS] Harden against buffer overflow · e62391a7
      niteria authored
      This sprintf is safe thanks to the guarantees on the format strings that
      we pass to it.  Well, almost. The GR_FILENAME_FMT_GUM format would not
      have satisfied them if it was still used.
      If someone makes a mistake that's a potential privilege escalation,
      so I think it's reasonable to switch to snprintf to protect against
      that remote possibility.
      Test Plan: it builds, CI
      Reviewers: simonmar, bgamari, austin, erikd
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3944
    • Moritz Angermann's avatar
      Use ar for -staticlib · 91262e75
      Moritz Angermann authored
      Hopefully we can get rid of libtool, by using ar only
      Depends on:  D3579
      Test Plan: validate
      Reviewers: austin, hvr, bgamari, erikd
      Reviewed By: bgamari
      Subscribers: rwbarton, thomie, erikd
      Differential Revision: https://phabricator.haskell.org/D3721
    • David Feuer's avatar
      Clarify Data.Data documentation · f8e383f0
      David Feuer authored
      Explain much more clearly when `dataCast1` and `dataCast2` can
      have non-trivial implementations. On a couple different occasions,
      I have attempted to write better defaults for these, only to
      discover that we can't really do that. The new documentation
      implicitly explains why that is.
      [skip ci]
      Reviewers: austin, hvr, bgamari, angerman
      Reviewed By: bgamari, angerman
      Subscribers: angerman, rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3926
    • Ben Gamari's avatar
      DriverMkDepend: Kill redundant import · d645e441
      Ben Gamari authored
      Reviewers: austin
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3941
    • Ben Gamari's avatar
      rts: Print message before SIGUSR2 backtrace · b890e88d
      Ben Gamari authored
      Reviewers: austin, erikd, simonmar
      Subscribers: rwbarton, thomie
      Differential Revision: https://phabricator.haskell.org/D3942
    • Ryan Scott's avatar
      Add regression test for #14209 · dafa0128
      Ryan Scott authored
      Commit 0257dacf
      (`Refactor bindHsQTyVars and friends`) ended up fixing #14209. Let's
      add a regression test so that it stays fixed.
      Test Plan: make test TEST=T14209
      Reviewers: austin, bgamari
      Subscribers: rwbarton, thomie
      GHC Trac Issues: #14209
      Differential Revision: https://phabricator.haskell.org/D3936
    • Ryan Scott's avatar
      Check if -XStaticPointers is enabled when renaming static expressions · 9ff9c358
      Ryan Scott authored
      Trying to use `static` expressions without the `-XStaticPointers`
      extension enabled can lead to runtime errors. Normally, such a situation isn't
      possible, but Template Haskell provides a backdoor that allows it to happen,
      as shown in #14204.
      To prevent this, we ensure that `-XStaticPointers` is enabled when renaming
      `static` expressions.
      Test Plan: make test TEST=T14204
      Reviewers: facundominguez, austin, bgamari, simonpj
      Reviewed By: facundominguez, simonpj
      Subscribers: simonpj, rwbarton, thomie
      GHC Trac Issues: #14204
      Differential Revision: https://phabricator.haskell.org/D3931
  3. 12 Sep, 2017 3 commits
  4. 09 Sep, 2017 6 commits
    • Herbert Valerio Riedel's avatar
      Retire cabal_macros_boot.h hack · 838a10fc
      Herbert Valerio Riedel authored
      I originally introduced this hack 3 years ago in
      b0379819, and finally we can
      retire it because starting with GHC 8.0 (which is the minimum
      required version to bootstrap GHC 8.4) these macros are generated
      natively by GHC.
    • Herbert Valerio Riedel's avatar
      Canonicalise MonoidFail instances in GHC · 346e562a
      Herbert Valerio Riedel authored
      IOW, code compiles -Wnoncanonical-monoidfail-instances clean now
      This is easy now since we require GHC 8.0/base-4.9 or later
      for bootstrapping.
      Note that we can easily enable `MonadFail` via
        default-extensions: MonadFailDesugaring
      in compiler/ghc.cabal.in
      which currently would point out that NatM doesn't have
      a proper `fail` method, even though failable patterns
      are made use of:
        compiler/nativeGen/SPARC/CodeGen.hs:425:25: error:
          * No instance for (Control.Monad.Fail.MonadFail NatM)
              arising from a do statement
              with the failable pattern ‘(dyn_c, [dyn_r])’
    • Herbert Valerio Riedel's avatar
      Canonicalise Monoid instances in GHC · dab0e515
      Herbert Valerio Riedel authored
      IOW, code compiles -Wnoncanonical-monoid-instances clean now
    • Herbert Valerio Riedel's avatar
      Remove makefile logic for legacy -this-package-key · 400ead81
      Herbert Valerio Riedel authored
      This isn't needed anymore as we don't support GHC < 8 anymore.
      This is a follow-up to 122f183d
    • Herbert Valerio Riedel's avatar
      Remove now redundant cabal conditionals in {ghc,template-haskell}.cabal · 122f183d
      Herbert Valerio Riedel authored
      In the past we needed the construct below for wired-in packages,
      but since GHC 8.0 (which we require at least for stage0 now) the CLI has
      stabilised, so we can unconditionally use `-this-unit-id` since GHC 8.0.
          if impl( ghc >= 7.11 )
      	ghc-options:  -this-unit-id template-haskell
      	if impl( ghc >= 7.9 )
      	    ghc-options:  -this-package-key template-haskell
      	    ghc-options:  -package-name template-haskell
    • Herbert Valerio Riedel's avatar
      Remove now redundant CPP · cf6b4d1c
      Herbert Valerio Riedel authored
      Resulting from requiring to boot with GHC 8.0 or later