1. 02 Oct, 2016 4 commits
  2. 01 Oct, 2016 5 commits
    • Ben Gamari's avatar
      Mark T11978a as broken due to #12019 · d1b4fec1
      Ben Gamari authored
      Test Plan: `validate --slow`
      
      Reviewers: austin
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2536
      
      GHC Trac Issues: #12019
      d1b4fec1
    • Matthew Pickering's avatar
      Move -dno-debug-output to the end of the test flags · f869b23e
      Matthew Pickering authored
      It is often convenient to copy the test invocation and remove this flag
      in order to see compiler traces. Moving it to the end makes it easier to
      remove.
      
      Remove trailing whitespace
      
      Reviewers: austin, thomie, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D2543
      f869b23e
    • mniip's avatar
      GHCi: Don't remove shadowed bindings from typechecker scope. · 59d7ee53
      mniip authored
      The shadowed out bindings are accessible via qualified names like
      Ghci1.foo.  Since they are accessable in the renamer the typechecker
      should be able to see them too.  As a consequence they show up in :show
      bindings.
      
      This fixes T11547
      
      Test Plan:
      Fixed current tests to accomodate to new stuff in :show bindings
      Added a test that verifies that the typechecker doesn't crash
      
      Reviewers: austin, bgamari, simonpj
      
      Reviewed By: simonpj
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2447
      
      GHC Trac Issues: #11547
      59d7ee53
    • Sylvain HENRY's avatar
      CodeGen X86: fix unsafe foreign calls wrt inlining · b61b7c24
      Sylvain HENRY authored
      Foreign calls (unsafe and safe) interact badly with inlining and
      register passing ABIs (see #11792 and #12614):
      the inlined code to compute a parameter of the call may overwrite a
      register already set to pass a preceding parameter.
      
      With this patch, we compute all parameters which are not simple
      expressions before assigning them to fixed registers required by the
      ABI.
      
      Test Plan:
         - Add test (test both reg and stack parameters)
         - Validate
      
      Reviewers: osa1, bgamari, austin, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2263
      
      GHC Trac Issues: #11792, #12614
      b61b7c24
    • Ryan Scott's avatar
      Implement deriving strategies · 9e862765
      Ryan Scott authored
      Allows users to explicitly request which approach to `deriving` to use
      via keywords, e.g.,
      
      ```
      newtype Foo = Foo Bar
        deriving Eq
        deriving stock    Ord
        deriving newtype Show
      ```
      
      Fixes #10598. Updates haddock submodule.
      
      Test Plan: ./validate
      
      Reviewers: hvr, kosmikus, goldfire, alanz, bgamari, simonpj, austin,
      erikd, simonmar
      
      Reviewed By: alanz, bgamari, simonpj
      
      Subscribers: thomie, mpickering, oerjan
      
      Differential Revision: https://phabricator.haskell.org/D2280
      
      GHC Trac Issues: #10598
      9e862765
  3. 30 Sep, 2016 5 commits
    • Simon Peyton Jones's avatar
      Make tcrun042 fail · 3f27237b
      Simon Peyton Jones authored
      This test uses wholesale impredicative polymorphism, and now fails.
      That's ok.
      3f27237b
    • Simon Peyton Jones's avatar
      Add missing stderr file · 5d473cd6
      Simon Peyton Jones authored
      ..accidentally omitted from previous commit.
      5d473cd6
    • Simon Peyton Jones's avatar
      Fix impredicativity (again) · b612da66
      Simon Peyton Jones authored
      This patch fixes Trac #12616.
      
      Dignosis.  In TcUnify.tc_sub_type_ds we were going to some trouble to
      support co- and contra-variance even for impredicative types.  With
      -XImpredicativeTYpes, this allowed a unification variable to be
      unified with a polytype (probably wrongly) and that caused later
      trouble in the constraint solver, where -XImpredicativeTypes was /not/
      on.  In effect, -XImpredicativeTypes can't be switched on locally.
      
      Why did we want ImpredicativeTypes locally?  Because the program
      generated by GND for a higher-rank method involved impredicative
      instantation of 'coerce':
            op = coerce op   -- where op has a higher rank type
      See Note [Newtype-deriving instances] in TcGenDeriv.
      
      Cure.
      
      1.  It is ghastly to rely on ImpredicativeTypes (a 100% flaky
          feature) to instantiate coerce polymorphically.  Happily we
          now have Visible Type Application, so I've used that instead
          which should be solid and reliable.
      
      2.  I deleted the code in tc_sub_type_ds that allows the constraint
          solver to "look through" a unification variable to find a
          polytype.  That used to be essential in the days of ReturnTv,
          but it's utterly unreliable and should be consigned to the dustbin
          of history.  (We have ExpType now for the essential uses.)
      
      Tests involving ImpredicativeTypes are affected, but I'm not worried
      about them... it's advertised as a feature you can't rely on, and
      I want to reform it outright.
      b612da66
    • Simon Peyton Jones's avatar
      Fix a bug in occurs checking · 66a8c194
      Simon Peyton Jones authored
      1. Trac #12593 exposed a long-standing bug in the occurs
         checking machinery.  When unifying two type variables
                a ~ b
         where a /= b, we were assuming that there could be
         no occurs-check error.  But there can: 'a' can occur
         in b's kind!  When the RHS was a non-tyvar we used
         occurCheckExpand, which /did/ look in kinds, but not
         when the RHS was a tyvar.
      
         This bug has been lurking ever since TypeInType, maybe
         longer.  And it was present both in TcUnify (the on-the-fly
         unifier), and in TcInteract.
      
         I ended up refactoring both so that the tyvar/tyvar
         path naturally goes through the same occurs-check as
         non-tyvar rhss.  It's simpler and more robust now.
      
         One good thing is that both unifiers now share
             TcType.swapOverVars
             TcType.canSolveByUnification
         previously they had different logic for the same goals
      
      2. Fixing this bug exposed another!  In T11635 we end
         up unifying
         (alpha :: forall k. k->*) ~ (beta :: forall k. k->*)
         Now that the occurs check is done for tyvars too, we
         look inside beta's kind.  And then reject the program
         becuase of the forall inside there.  But in fact that
         forall is fine -- it does not count as impredicative
         polymoprhism.   See Note [Checking for foralls]
         in TcType.
      
      3. All this fuss around occurrence checking forced me
         to look at TcUnify.checkTauTvUpdate
                and TcType.occurCheckExpand
         There's a lot of duplication there, and I managed
         to elminate quite a bit of it. For example,
         checkTauTvUpdate called a local 'defer_me'; and then
         called occurCheckExpand, which then used a very
         similar 'fast_check'.
      
         Things are better, but there is more to do.
      66a8c194
    • Simon Peyton Jones's avatar
      Fix desugaring of pattern bindings (again) · 2fbfbca2
      Simon Peyton Jones authored
      This patch fixes Trac #12595.  The problem was with a
      pattern binding like
           !x = e
      For a start it's silly to match that pattern and build
      a unit tuple (the General Case of mkSelectorBinds); but
      that's what was happening because the bang fell through
      to the general case.  But for a variable pattern building
      any auxiliary bindings is stupid.  So the patch
      introduces a new case in mkSelectorBinds for variable
      patterns.
      
      Then it turned out that if 'e' was a plain variable, and
      moreover was imported GlobalId, then matchSinglePat made
      it a /bound/ variable, which should never happen.  That
      ultimately caused a linker error, but the original bug
      was much earlier.
      2fbfbca2
  4. 29 Sep, 2016 1 commit
  5. 28 Sep, 2016 1 commit
  6. 26 Sep, 2016 2 commits
  7. 24 Sep, 2016 2 commits
  8. 23 Sep, 2016 1 commit
    • Richard Eisenberg's avatar
      Fix #12442. · 9766b0c8
      Richard Eisenberg authored
      The problem is described in the ticket.
      
      This patch adds new variants of the access points to the pure
      unifier that allow unification of types only when the caller
      wants this behavior. (The unifier used to also unify kinds.)
      This behavior is appropriate when the kinds are either already
      known to be the same, or the list of types provided are a
      list of well-typed arguments to some type constructor. In the
      latter case, unifying earlier types in the list will unify the
      kinds of any later (dependent) types.
      
      At use sites, I went through and chose the unification function
      according to the criteria above.
      
      This patch includes some modest performance improvements as we
      are now doing less work.
      9766b0c8
  9. 21 Sep, 2016 1 commit
    • Tamar Christina's avatar
      Fix failing test T12504 · 8bd3d417
      Tamar Christina authored
      Summary:
      Test T12504 does it's checking in the Makefile using grep but still specified an stdout.
      the stdout has the old output and would always fail.
      
      Since the stdout isn't needed, let's not check it.
      
      Test Plan: make test TEST=T12504
      
      Reviewers: bgamari, austin, erikd, rcook
      
      Reviewed By: rcook
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2537
      
      GHC Trac Issues: #12504
      8bd3d417
  10. 15 Sep, 2016 2 commits
  11. 12 Sep, 2016 4 commits
    • Simon Peyton Jones's avatar
      Testsuite wibbles, to the same files · ec3edd56
      Simon Peyton Jones authored
      Sigh.  I added some comments to the source files,
      and failed to revalidate.  But the comments change the
      line number in the error messages.  Doh.
      ec3edd56
    • Simon Peyton Jones's avatar
      Test wibbles for commit 03541cba · 5eeabe25
      Simon Peyton Jones authored
      I must have failed to validate properly, sorry.
      These testsuite wibbles belong with
      
        commit 03541cba
        Author: Simon Peyton Jones <simonpj@microsoft.com>
        Date:   Fri Sep 9 17:42:42 2016 +0100
      
            Be less picky about reporing inaccessible code
      5eeabe25
    • Simon Peyton Jones's avatar
      Be less picky about reporing inaccessible code · 03541cba
      Simon Peyton Jones authored
      Triggered by the discussion on Trac #12466, this patch
      makes GHC less aggressive about reporting an error when
      there are insoluble Givens.
      
      Being so agressive was making some libraries fail to
      compile, and is arguably wrong in at least some cases.
      See the discussion on the ticket.
      
      Several test now pass when they failed before; see
      the files-modified list for this patch.
      03541cba
    • Simon Marlow's avatar
      Add hs_try_putmvar() · 454033b5
      Simon Marlow authored
      Summary:
      This is a fast, non-blocking, asynchronous, interface to tryPutMVar that
      can be called from C/C++.
      
      It's useful for callback-based C/C++ APIs: the idea is that the callback
      invokes hs_try_putmvar(), and the Haskell code waits for the callback to
      run by blocking in takeMVar.
      
      The callback doesn't block - this is often a requirement of
      callback-based APIs.  The callback wakes up the Haskell thread with
      minimal overhead and no unnecessary context-switches.
      
      There are a couple of benchmarks in
      testsuite/tests/concurrent/should_run.  Some example results comparing
      hs_try_putmvar() with using a standard foreign export:
      
          ./hs_try_putmvar003 1 64 16 100 +RTS -s -N4     0.49s
          ./hs_try_putmvar003 2 64 16 100 +RTS -s -N4     2.30s
      
      hs_try_putmvar() is 4x faster for this workload (see the source for
      hs_try_putmvar003.hs for details of the workload).
      
      An alternative solution is to use the IO Manager for this.  We've tried
      it, but there are problems with that approach:
      * Need to create a new file descriptor for each callback
      * The IO Manger thread(s) become a bottleneck
      * More potential for things to go wrong, e.g. throwing an exception in
        an IO Manager callback kills the IO Manager thread.
      
      Test Plan: validate; new unit tests
      
      Reviewers: niteria, erikd, ezyang, bgamari, austin, hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2501
      454033b5
  12. 11 Sep, 2016 1 commit
    • Ryan Scott's avatar
      Fix derived Ix instances for one-constructor GADTs · 7b7ea8f4
      Ryan Scott authored
      Summary:
      Standalone-derived `Ix` instances would panic on GADTs with exactly
      one constructor, since the list of fields was being passed to a function that
      uses `foldl1` in order to generate an implementation for `inRange`. This adds a
      simple check that makes `inRange` be `True` whenever a product type has no
      fields.
      
      Fixes #12583.
      
      Test Plan: make test TEST=12583
      
      Reviewers: simonpj, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2521
      
      GHC Trac Issues: #12583
      7b7ea8f4
  13. 08 Sep, 2016 1 commit
  14. 05 Sep, 2016 6 commits
    • takano-akio's avatar
      Make the test for #11108 less fragile · a7a960e4
      takano-akio authored
      This change should close #11108 by fixing the test case.
      
      This commit fixes two issues:
      
      * Make sure that each weak pointer we allocate has a constructor as the
        key, not a thunk. A failure to do so meant these weak pointers died
        prematurely on the 'ghci' WAY.
      
      * Don't print anything in the finalizer, because they are not guaranteed
        to run.
      
      Test Plan: validate
      
      Reviewers: austin, simonmar, erikd, bgamari
      
      Reviewed By: erikd, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2512
      
      GHC Trac Issues: #11108
      a7a960e4
    • Ryan Scott's avatar
      Derive the Generic instance in perf/compiler/T5642 · 34010dbe
      Ryan Scott authored
      Summary:
      For some inexplicable reason, the `Generic` instance in
      `perf/compiler/T5642` is written out entirely by hand. This is not only
      strange, since Trac #5642 is about derived `Generic` instances, but it also
      annoying to maintain, since it requires manually changing a bunch of code
      whenever the algorithm behind `deriving Generic` changes. (See D2304 for a
      recent example of this.)
      
      It seems more sensible to just derive the `Generic` instance. It shifts the
      goalposts of what allocations we're measuring a bit, since we no longer have
      to parse a large amount of code (and as a knock-on effect, the allocations go
      down a bit). But I think this program is morally equivalent to what we were
      benchmarking before, so it's not too unreasonable to change.
      
      Test Plan: make test TEST=T5642
      
      Reviewers: austin, thomie, bgamari
      
      Reviewed By: bgamari
      
      Differential Revision: https://phabricator.haskell.org/D2511
      
      GHC Trac Issues: #5642
      34010dbe
    • prokhorenkov's avatar
      Make generated Ord instances smaller (per #10858). · 4ff4929c
      prokhorenkov authored
      Reviewers: simonpj, bgamari, RyanGlScott, austin
      
      Reviewed By: simonpj
      
      Subscribers: nomeata, simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2502
      
      GHC Trac Issues: #10858
      4ff4929c
    • mniip's avatar
      Less scary arity mismatch error message when deriving · 8d00175f
      mniip authored
      Test Plan: Corrected a few tests to include the new message.
      
      Reviewers: goldfire, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: goldfire, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2484
      
      GHC Trac Issues: #12546
      8d00175f
    • takano-akio's avatar
      Turn divInt# and modInt# into bitwise operations when possible · 6ea62427
      takano-akio authored
      This implements #5615 for divInt# and modInt#.
      
      I also included rules to do constant-folding when the both arguments
      are known.
      
      Test Plan: validate
      
      Reviewers: austin, simonmar, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: hvr, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2486
      
      GHC Trac Issues: #5615
      6ea62427
    • Facundo Domínguez's avatar
      Don't ignore addTopDecls in module finalizers. · 71dd6e44
      Facundo Domínguez authored
      Summary:
      Module finalizer could call addTopDecls, however, the declarations
      added in this fashion were ignored. This patch makes sure to rename,
      type check and incorporate this declarations.
      
      Because a declaration may include a splice which calls addModFinalizer,
      the list of finalizers is repeteadly checked after adding declarations
      until no more finalizers remain.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, goldfire, simonpj, austin
      
      Reviewed By: bgamari, simonpj
      
      Subscribers: simonmar, mboes, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2505
      
      GHC Trac Issues: #12559
      71dd6e44
  15. 04 Sep, 2016 2 commits
  16. 02 Sep, 2016 1 commit
  17. 01 Sep, 2016 1 commit
    • Tamar Christina's avatar
      Added support for deprecated POSIX functions on Windows. · e5ecb201
      Tamar Christina authored
      Summary:
      With the introduction of 8.0.1 We've stopped supporting in GHCi
      the use of POSIX functions under their deprecated names on Windows.
      
      This to be compatible with object and libraries from the most
      popular compilers on the platform (Microsoft and Intel compilers).
      
      However this brings a confusing disparity between the compiled and
      interpreted behavior since MingW-W64 does support the deprecated names.
      
      Also It seems clear that package writers won't update their packages to
      properly support Windows. As such I have added redirects in the RTS
      for the deprecated functions as listed on
      
      https://msdn.microsoft.com/en-us/library/ms235384.aspx.
      
      This won't export the functions (as in, they won't be in the symbol table
      of compiled code for the RTS.) but we inject them into the symbol table
      of the dynamic linker at startup.
      
      Test Plan:
      ./validate
      and
      
      make test TEST="ffi017 ffi021"
      
      Reviewers: thomie, simonmar, RyanGlScott, bgamari, austin, hvr, erikd
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: RyanGlScott, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2500
      
      GHC Trac Issues: #12209, #12497, #12496
      e5ecb201