Skip to content
Snippets Groups Projects
  1. Mar 27, 2017
  2. Mar 24, 2017
    • rwbarton's avatar
      x86 nativeGen: Fix test with mask in range [128,255] (#13425) · 85dc0627
      rwbarton authored and Ben Gamari's avatar Ben Gamari committed
      My commit bdb0c43c optimized the encoding of instructions to test
      tag bits, but it did not always set exactly the same condition codes
      since the testb instruction does a single-byte comparison, rather
      than a full-word comparison.
      
      It would be correct to optimize the expression `x .&. 128 > 0` to
      the sequence
      
          testb $128, %al
          seta %al         ; note: 'a' for unsigned comparison,
                           ; not 'g' for signed comparison
      
      but the pretty-printer is not the right place to make this kind of
      context-sensitive optimization.
      
      Test Plan: harbormaster
      
      Reviewers: trofi, austin, bgamari, dfeuer
      
      Reviewed By: trofi, dfeuer
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3359
      
      (cherry picked from commit caf94b06)
      85dc0627
    • Ben Gamari's avatar
      config.mk.in: Add bzip, gzip, and xz executable names to be overridden · efa9f0fe
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Reviewers: austin, hvr, erikd
      
      Reviewed By: erikd
      
      Subscribers: rwbarton, thomie, erikd, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3367
      
      (cherry picked from commit 1b374402)
      efa9f0fe
    • Rufflewind's avatar
      Allow colors to be customized · 7141a183
      Rufflewind authored and Ben Gamari's avatar Ben Gamari committed
      Allow customization of diagnostic colors through the GHC_COLORS
      environment variable.  Some color-related code have been refactored to
      PprColour to reduce the circular dependence between DynFlags,
      Outputable, ErrUtils.  Some color functions that were part of Outputable
      but were never used have been deleted.
      
      Test Plan: validate
      
      Reviewers: austin, hvr, bgamari, dfeuer
      
      Reviewed By: bgamari, dfeuer
      
      Subscribers: dfeuer, rwbarton, thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3364
      
      (cherry picked from commit adf27d61)
      7141a183
  3. Mar 23, 2017
  4. Mar 22, 2017
    • Edward Z. Yang's avatar
      Correctly account for -package-db ordering when picking packages. · 1682980d
      Edward Z. Yang authored
      
      Summary:
      When I originally implemented ABI-based shadowing as per
      ee4e1654, I switched our strategy
      from pasting together lists to creating a map of all units first,
      and then selecting packages from this.  However, what I did
      not realize when doing this was that we actually depended
      on the *ordering* of these lists later, when we selected
      a preferred package to use.
      
      The crux is if I have -package-db db1 -package-db db2 -package p-0.1,
      and p-0.1 is provided by both db1 and db2, which one does the
      -package flag select?  Previously, this was undetermined; now
      we always select the instance from the LATEST package database.
      (If p-0.1 shows up multiple times in the same database, once again
      the chosen package is undefined.)
      
      The reason why cabal08 intermittently failed was that, in practice,
      we were sorting on the UnitId, so when we bumped version numbers,
      that often wibbled the UnitIds so that they compared oppositely.
      I've extended the test so that we check that the relation is
      antisymmetric.
      
      Fixes #13313
      
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3369
      
      (cherry picked from commit e0eaea91)
      1682980d
    • David Feuer's avatar
      Make unsafeInterleaveST less unsafe · 167548f4
      David Feuer authored
      * Make `unsafeInterleaveST` use `noDuplicate#` like
      `unsafeInterleaveIO` does to prevent the suspended action from
      being run in two threads.
      
      * In order to accomplish this without `unsafeCoerce#`, generalize
      the type of `noDuplicate#`.
      
      * Add `unsafeDupableInterleaveST` to get the old behavior.
      
      * Document unsafe `ST` functions and clean up some related
      documentation.
      
      Fixes #13457
      
      Reviewers: austin, hvr, bgamari, ekmett
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3370
      
      (cherry picked from commit 30d68d63)
      167548f4
  5. Mar 21, 2017
  6. Mar 20, 2017
    • Ben Gamari's avatar
      Never tick primitive string literals · 22519050
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      This is a more aggressive approach to the problem initially solved in
      f5b275a2, where top-level primitive string
      literals were being wrapped by ticks. This breaks the Core invariant descirbed
      in Note [CoreSyn top-level string literals]. However, the previous approach was
      incomplete and left several places where inappropriate ticks could sneak in.
      
      This commit kills the problem at the source: we simply never tick any primitive
      string literal expression. The assumption here is that these expressions are
      destined for the top-level, where they cannot be ticked, anyways. So even if
      they haven't been floated out yet there is no reason to tick them.
      
      This partially reverts commit f5b275a2.
      
      Test Plan: Validate with `-g`
      
      Reviewers: austin, scpmw, simonpj, simonmar, dfeuer
      
      Subscribers: dfeuer, simonmar, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3063
      22519050
  7. Mar 18, 2017
  8. Mar 15, 2017
    • Ben Gamari's avatar
      Bump hsc2hs submodule · 6ebfbdfb
      Ben Gamari authored
      (cherry picked from commit ba431051)
      6ebfbdfb
    • Andrzej Rybczak's avatar
      Decrease locked region size on Windows to fix ERROR_LOCK_INVALID_RANGE · d18d3d94
      Andrzej Rybczak authored and Ben Gamari's avatar Ben Gamari committed
      Reviewers: austin, hvr, bgamari
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3345
      
      (cherry picked from commit 7e273ea2)
      d18d3d94
    • Ben Gamari's avatar
      Bump hsc2hs submodule · 59f72c9a
      Ben Gamari authored
      Fixes #13388. Also updates the expected output for T12504, which
      previously contained a redundant LINE pragma.
      59f72c9a
    • Ryan Scott's avatar
      Further document :type +v's role in analyzing -XTypeApplications in GHCi · 7596efd6
      Ryan Scott authored
      Summary:
      The section on `-XTypeApplications` in the users' guide isn't terribly
      clear on how to view the visibility of a function type signature's type
      variables in GHCi properly (i.e., using the `:type +v` GHCi command). This
      adds some more exposition that demonstrates how to use `:type +v` (and why you
      don't want to use `:type`).
      
      Fixes #13401.
      
      Test Plan: Eyeball it
      
      Reviewers: bgamari, austin, goldfire, crockeea
      
      Reviewed By: goldfire, crockeea
      
      Subscribers: rwbarton, thomie, crockeea
      
      Differential Revision: https://phabricator.haskell.org/D3310
      
      (cherry picked from commit b335f506)
      7596efd6
    • Ben Gamari's avatar
      e71c9c86
    • Ben Gamari's avatar
      testsuite: Fix peak_megabytes_allocated for T4029 · e59b6026
      Ben Gamari authored
      It seems I must have dropped the update of the expected value during a conflict
      resolution.
      e59b6026
    • Tamar Christina's avatar
      Fix Windows GCC driver · 018ac7f4
      Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
      In Windows 10 Insiders build 15019+ which will probably be released
      mainstream somewhere this year Microsoft seems to have started being
      stricter with API calls.
      
      The call to `FreeConsole` just after `CreateProcess` is making Windows
      treat the process
      as an interactive process. In which case it tries to use the `Desktop
      session` but fails resulting
      in the cryptic error reported.
      
      I don't understand why the call to `FreeConsole` was there and it
      doesn't seem to be needed,
      so removed.
      
      This fixes #13411
      
      Test Plan: ./validate, alternative just do anything with ghc which
      requires compilation.
      
      Reviewers: austin, bgamari, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D3319
      
      (cherry picked from commit 4b673e80)
      018ac7f4
    • Richard Eisenberg's avatar
      Fix #13337. · 109a2429
      Richard Eisenberg authored and Ben Gamari's avatar Ben Gamari committed
      The big change is the introduction of solveSomeEqualities. This
      is just like solveEqualities, but it doesn't fail if there are unsolved
      equalities when it's all done. Anything unsolved is re-emitted. This
      is appropriate if we are not kind-generalizing, so this new form
      is used when decideKindGeneralizationPlan says not to.
      
      We initially thought that any use of solveEqualities would be tied
      to kind generalization, but this isn't true. For example, we need
      to solveEqualities a bunch in the "tc" pass in TcTyClsDecls (which
      is really desugaring). These equalities are all surely going to be
      soluble (if they weren't the "kc" pass would fail), but we still
      need to solve them again. Perhaps if the "kc" pass produced type-
      checked output that is then desugared, solveEqualities really would
      be tied only to kind generalization.
      
      Updates haddock submodule.
      
      Test Plan: ./validate, typecheck/should_compile/T13337
      
      Reviewers: simonpj, bgamari, austin
      
      Reviewed By: simonpj
      
      Subscribers: RyanGlScott, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3315
      
      (cherry picked from commit e0c433c8)
      109a2429
    • Simon Peyton Jones's avatar
      Fix constraint simplification in rules · 98692134
      Simon Peyton Jones authored
      Trac #13381 showed that we were losing track of a wanted constraint
      when simplifying the LHS constraints for a RULE.
      
      This patch fixes it, makes the code a bit simpler, and better
      documented.
      
      (cherry picked from commit af6ed4a6)
      98692134
    • Ben Gamari's avatar
      Update test output · bb51a99b
      Ben Gamari authored
      bb51a99b
    • Simon Peyton Jones's avatar
      Define TcSimplify.simplifyTopImplic and use it · 8a526c1c
      Simon Peyton Jones authored
      A very small refactoring
      
      (cherry picked from commit 2d3cb34a)
      8a526c1c
    • Simon Peyton Jones's avatar
      Improve error messages for skolems · 026189aa
      Simon Peyton Jones authored
      In error messages like this
          • Couldn't match type ‘c’ with ‘f0 (a -> b)’
            ‘c’ is a rigid type variable bound by
              the type signature for:
                f :: ((a -> b) -> b) -> forall c. c -> a
      
      we need to take case both to actually show that 'forall c',
      and to make sure that its name lines with the 'c' in the
      error message.
      
      This has been shaky for some time, and this commit puts it on solid
      ground.  See TcRnTypes: Note [SigSkol SkolemInfo]
      
      The main changes are
      
      * SigSkol gets an extra field that records the way in which the
        type signature was skolemised.
      
      * The type in SigSkol is now the /un/-skolemised version
      
      * pprSkolemInfo uses the info to make the tidy type line up
        nicely
      
      Lots of error message wibbles!
      
      (cherry-picked from 48d1866e)
      026189aa
    • Ryan Scott's avatar
      Allow associated types to pattern-match in non-class-bound variables · 82366c4c
      Ryan Scott authored
      Summary:
      After 8136a5cb (#11450), if you have
      a class with an associated type:
      
      ```
      class C a where
        type T a b
      ```
      
      And you try to create an instance of `C` like this:
      
      ```
      instance C Int where
        type T Int Char = Bool
      ```
      
      Then it is rejected, since you're trying to instantiate the variable ``b`` with
      something other than a type variable. But this restriction proves quite
      onerous in practice, as it prevents you from doing things like this:
      
      ```
      class C a where
        type T a (b :: Identity c) :: c
      
      instance C Int where
        type T Int ('Identity x) = x
      ```
      
      You have to resort to an auxiliary type family in order to define this now,
      which becomes extremely tiring. This lifts this restriction and fixes #13398,
      in which it was discovered that adding this restriction broke code in the wild.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, bgamari, austin
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3302
      
      (cherry picked from commit 67345ccf)
      82366c4c
  9. Mar 14, 2017
    • Simon Peyton Jones's avatar
      Fix CaseIdentity optimisation AGAIN · dfd8f29e
      Simon Peyton Jones authored
      In this commit
          commit 02ac2974
          Author: Simon Peyton Jones <simonpj@microsoft.com>
          Date:   Wed Nov 16 10:37:47 2011 +0000
      
          Fix CaseIdentity optimisaion
      
          In fixing one bug I'd introduced another;
             case x of { T -> T; F -> F }
          wasn't getting optmised!  Trivial to fix.
      
      I introduced yet another!  This line of code in SimplUtils.mkCase1
      
          check_eq (Var v)    (DataAlt con) []   = v == dataConWorkId con
                                                   -- Optimisation only
      
      is patently false when arg_tys is non-empty.  Astonishing that it
      has not shown up before now.
      
      Easily fixed though.  This was all shown up by Trac #13417, which is
      now fixed.
      
      Merge to 8.0, 8.2.
      dfd8f29e
  10. Mar 13, 2017
Loading