Skip to content
Snippets Groups Projects
  1. Oct 28, 2018
    • sheaf's avatar
      plugins: search for .a files if necessary · d2cd150e
      sheaf authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      on windows, plugins are loaded via .a files,
      but those paths were not being searched when loading plugins
      
      Test Plan: ./validate
      
      Reviewers: Phyx, bgamari
      
      Reviewed By: Phyx
      
      Subscribers: RyanGlScott, rwbarton, carter
      
      GHC Trac Issues: #15700
      
      Differential Revision: https://phabricator.haskell.org/D5253
      
      (cherry picked from commit 70298db16c3f0ea4adb603ccb2b5e93eb9c7a556)
      d2cd150e
    • Christiaan Baaij's avatar
      Comment out CONSTANT_FOLDED in GHC.Natural · de9a8feb
      Christiaan Baaij authored
      Summary:
      Although these functions were marked as CONSTANT_FOLDED, they did
      not have a corresponding builtinRule in PrelRules. The idea was
      probably to add them eventually, but this hasn't manifested so
      far.
      
      The plan is to eventually add builtin rules for these functions
      over Natural, so as a reminder we simply comment out the
      CONSTANT_FOLDED  annotation instead of removing it completely.
      
      Reviewers: hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5267
      
      (cherry picked from commit 3ec6fe8827956cc36b58cdf0bb1f5752eaa2a8ea)
      de9a8feb
    • Fangyi Zhou's avatar
      Fix integer overflow when encoding doubles (Trac #15271) · 37d14601
      Fangyi Zhou authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      Ticket #15271 reports a case where 1e1000000000 is incorrectly
      converted to 0.0. After some investigation, I discovered the number is
      converted to rational correctly, but converting the ratio into a double
      introduced an error.
      
      Tracking down to how the conversion is done, I found the rts float
      implementation uses `ldexp`, whose signature is
      `double ldexp (double x, int exp);`
      The callsite passes an `I_` to the second argument, which is
      platform-dependent. On machines where `I_` is 64 bits and `int` is 32 bits, we
      observe integer overflow behaviour.
      
      Here is a mapping from rational to exponent with observations
      1e646457008  -> 2147483645 (result = infinity, positive in int32)
      1e646457009  -> 2147483648 (result = 0.0, overflow to negative in int32)
      1e1000000000 -> 3321928042 (result = infinity, overflow to positive in int32)
      1e1555550000 -> 5167425196 (result = 0.0, overflow to negative in int32)
      
      We fix this issue by comparing STG_INT_MIN/MAX and INT_MIN/MAX and bound the
      value appropriately.
      
      Test Plan: New test cases
      
      Reviewers: bgamari, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15271
      
      Differential Revision: https://phabricator.haskell.org/D5271
      
      (cherry picked from commit 311a63979cfa2c1e81be54b82205e681f6ec4f14)
      37d14601
    • Ningning Xie's avatar
      Fix `:k` command: add validity checking · 804518f7
      Ningning Xie authored
      Summary:
      This patch fixes #15806, where we found that the `:k` command in GHCi
      misses a validity checking for the type.
      
      Missing validity checking causes `:k` to accept types that are not validated.
      For example, `:k (Maybe (forall a. a -> a))` (incorrectly) returns `*`, while
      impredictivity of type instantiation shouldn't be allowed.
      
      Test Plan: ./validate
      
      Reviewers: simonpj, goldfire, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15806
      
      Differential Revision: https://phabricator.haskell.org/D5265
      
      (cherry picked from commit 12cb5cf50b8b35394e2e2d57e1ac693c76f90833)
      804518f7
    • Ben Gamari's avatar
      includes: Allow headers to be built with C++11 compilers · b539a99c
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      Fixes #14784. Note that C++11 is quite conservative; we could likely accept
      C++03 as well.
      
      Test Plan:
      ```
      $ cat >hi.c <<EOF
      #include <Rts.h>
      EOF
      $ g++ -std=c++11 hi.c
      ```
      
      Reviewers: simonmar, hvr
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #14784
      
      Differential Revision: https://phabricator.haskell.org/D5244
      
      (cherry picked from commit d3a1022fabb0ad337003fac774c6929f402ecb8b)
      b539a99c
    • Zejun Wu's avatar
      Fix rare undefined asm temp end label error in x86 · 38618f74
      Zejun Wu authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      Encountered assembly error due to undefined label `.LcaDcU_info_end` for
      following code generated by `pprFrameProc`:
      
      ```
      .Lsat_sa8fp{v}_info_fde_end:
        .long .Lblock{v caDcU}_info_fde_end-.Lblock{v caDcU}_info_fde
      .Lblock{v caDcU}_info_fde:
        .long _nbHlD-.Lsection_frame
        .quad block{v caDcU}_info-1
        .quad .Lblock{v caDcU}_info_end-block{v caDcU}_info+1
        .byte 1
      ```
      
      This diff fixed the error.
      
      Test Plan:
        ./validate
      
      Also the case where we used to have assembly error is now fixed.
      Unfortunately, I have limited insight here and cannot get a small enough repro
      or test case for this.
      
      Ben says:
      
      > I think I see: Previously we only produced end symbols for the info
      > tables of top-level procedures. However, blocks within a procedure may
      > also have info tables, we will dutifully generate debug information for
      > and consequently we get undefined symbols.
      
      Reviewers: simonmar, scpmw, last_g, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5246
      
      (cherry picked from commit cf961dcf5ebc26cbd960196ba387736334088303)
      38618f74
    • Kavon Farvardin's avatar
      Fix for T14251 on ARM · 2e23e1c7
      Kavon Farvardin authored and Ben Gamari's avatar Ben Gamari committed
      We now calculate the SSE register padding needed to fix the calling
      convention in LLVM in a robust way: grouping them by whether
      registers in that class overlap (with the same class overlapping
      itself).
      
      My prior patch assumed that no matter the platform, physical
      register Fx aliases with Dx, etc, for our calling convention.
      
      This is unfortunately not the case for any platform except x86-64.
      
      Test Plan:
      Only know how to test on x86-64, but it should be tested on ARM with:
      
      `make test WAYS=llvm && make test WAYS=optllvm`
      
      Reviewers: bgamari, angerman
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15780, #14251, #15747
      
      Differential Revision: https://phabricator.haskell.org/D5254
      
      (cherry picked from commit c36a2b596a6ba9d7a0a80df01b3c041720c727ca)
      2e23e1c7
  2. Oct 24, 2018
  3. Oct 17, 2018
  4. Oct 16, 2018
    • Ben Gamari's avatar
      base: Fill in TBAs in changelog · f7b1ee96
      Ben Gamari authored
      I've added a check in my release script to ensure that this doesn't happen in
      the future.
      
      (cherry picked from commit 2605458930f2d79738fab4437f10793448d4232c)
      f7b1ee96
  5. Oct 13, 2018
    • Ömer Sinan Ağacan's avatar
      Fix dataToTag# argument evaluation · b11126fc
      Ömer Sinan Ağacan authored
      See #15696 for more details. We now always enter dataToTag# argument (done in
      generated Cmm, in StgCmmExpr). Any high-level optimisations on dataToTag#
      applications are done by the simplifier. Looking at tag bits (instead of
      reading the info table) for small types is left to another diff.
      
      Incorrect test T14626 is removed. We no longer do this optimisation (see
      comment:44, comment:45, comment:60).
      
      Comments and notes about special cases around dataToTag# are removed. We no
      longer have any special cases around it in Core.
      
      Other changes related to evaluating primops (seq# and dataToTag#) will be
      pursued in follow-up diffs.
      
      Test Plan: Validates with three regression tests
      
      Reviewers: simonpj, simonmar, hvr, bgamari, dfeuer
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15696
      
      Differential Revision: https://phabricator.haskell.org/D5201
      
      (cherry picked from commit ac977688)
      b11126fc
    • Simon Peyton Jones's avatar
      Do not mark CoVars as dead in the occur-anal · a22ee705
      Simon Peyton Jones authored
      For years we have been marking CoVars as dead, becuase we
      don't gather occurrence info from types.  This is obviously
      wrong and caused Trac #15695.
      
      See Note [Do not mark CoVars as dead] in OccurAnal.
      
      (cherry picked from commit 02b303ee)
      a22ee705
    • Simon Marlow's avatar
      Fix for recover with -fexternal-interpreter (#15418) · a04ecd7b
      Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      When using -fexternal-interpreter, recover was not treating a Q
      compuation that simply registered an error with addErrTc as failing.
      
      Test Plan:
      New unit tests:
      * T15418 is the repro from in the ticket
      * TH_recover_warns is a new test to ensure that we're keeping warnings when
        the body of recover succeeds.
      
      Reviewers: bgamari, RyanGlScott, angerman, goldfire, erikd
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15418
      
      Differential Revision: https://phabricator.haskell.org/D5185
      
      (cherry picked from commit d00c3086)
      a04ecd7b
    • Alec Theriault's avatar
      GHCi should not filter instances involving cTuples · 51c44793
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      Summary: See the new T12005 test case for an example of this.
      
      Test Plan: make TEST=T12005
      
      Reviewers: bgamari, osa1
      
      Reviewed By: osa1
      
      Subscribers: osa1, rwbarton, carter
      
      GHC Trac Issues: #12005
      
      Differential Revision: https://phabricator.haskell.org/D5182
      
      (cherry picked from commit 21efbc75)
      51c44793
    • Vladislav Zavialov's avatar
      Add -Wstar-is-type to the User's Guide · 4ab2f347
      Vladislav Zavialov authored and Ben Gamari's avatar Ben Gamari committed
      The -Wstar-is-type flag was added without documentation.
      Now it has documentation.
      
      Test Plan: Validate
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5203
      
      (cherry picked from commit 07083fc4)
      4ab2f347
    • Ömer Sinan Ağacan's avatar
      Fix slop zeroing for AP_STACK eager blackholes in debug build · 10e3125d
      Ömer Sinan Ağacan authored
      As #15571 reports, eager blackholing breaks sanity checks as we can't
      zero the payload when eagerly blackholing (because we'll be using the
      payload after blackholing), but by the time we blackhole a previously
      eagerly blackholed object (in `threadPaused()`) we don't have the
      correct size information for the object (because the object's type
      becomes BLACKHOLE when we eagerly blackhole it) so can't properly zero
      the slop.
      
      This problem can be solved for AP_STACK eager blackholing (which unlike
      eager blackholing in general, is not optional) by zeroing the payload
      after entering the stack. This patch implements this idea.
      
      Fixes #15571.
      
      Test Plan:
      Previously concprog001 when compiled and run with sanity checks
      
          ghc-stage2 Mult.hs -debug -rtsopts
          ./Mult +RTS -DS
      
      was failing with
      
          Mult: internal error: checkClosure: stack frame
              (GHC version 8.7.20180821 for x86_64_unknown_linux)
              Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
      
      thic patch fixes this panic. The test still panics, but it runs for a while
      before panicking (instead of directly panicking as before), and the new problem
      seems unrelated:
      
          Mult: internal error: ASSERTION FAILED: file rts/sm/Sanity.c, line 296
              (GHC version 8.7.20180919 for x86_64_unknown_linux)
              Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
      
      The new problem will be fixed in another diff.
      
      I also tried slow validate (which requires D5164): this does not introduce any
      new failures.
      
      Reviewers: simonmar, bgamari, erikd
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15571
      
      Differential Revision: https://phabricator.haskell.org/D5165
      
      (cherry picked from commit 66c17293)
      10e3125d
    • Roland Senn's avatar
      Compiler panic on invalid syntax (unterminated pragma) · 52304776
      Roland Senn authored
      Summary: After a parse error in OPTIONS_GHC issue an error message instead of a compiler panic.
      
      Test Plan: make test TEST=T15053
      
      Reviewers: Phyx, thomie, bgamari, monoidal, osa1
      
      Reviewed By: Phyx, monoidal, osa1
      
      Subscribers: tdammers, osa1, rwbarton, carter
      
      GHC Trac Issues: #15053
      
      Differential Revision: https://phabricator.haskell.org/D5093
      
      (cherry picked from commit df363a64)
      52304776
    • Ben Gamari's avatar
      testsuite: Add test for #15053 · 377975e0
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Reviewers: Phyx
      
      Reviewed By: Phyx
      
      Subscribers: Phyx, rwbarton, thomie, carter
      
      GHC Trac Issues: #15053
      
      Differential Revision: https://phabricator.haskell.org/D4883
      
      (cherry picked from commit f03f0d61)
      377975e0
    • Alec Theriault's avatar
      Don't show constraint tuples in errors (#14907) · 87266ea7
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      This means that 'GHC.Classes.(%,%)' is no longer mentioned in
      error messages for things like
      
         class (a,b,c)  -- outside of 'GHC.Classes'
         class (a,Bool)
      
      Test Plan: make TEST=T14907a && make TEST=T14907b
      
      Reviewers: RyanGlScott, bgamari
      
      Reviewed By: RyanGlScott
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #14907
      
      Differential Revision: https://phabricator.haskell.org/D5172
      
      (cherry picked from commit 9bfbc4e1)
      87266ea7
  6. Oct 07, 2018
  7. Oct 05, 2018
    • Ryan Scott's avatar
      Be mindful of GADT tyvar order when desugaring record updates · 0af55c12
      Ryan Scott authored
      After commit ef26182e,
      the type variable binders in GADT constructor type signatures
      are now quantified in toposorted order, instead of always having
      all the universals before all the existentials. Unfortunately, that
      commit forgot to update some code (which was assuming the latter
      scenario) in `DsExpr` which desugars record updates. This wound
      up being the cause of #15499.
      
      This patch makes up for lost time by desugaring record updates in
      a way such that the desugared expression applies type arguments to
      the right-hand side constructor in the correct order—that is, the
      order in which they were quantified by the user.
      
      Test Plan: make test TEST=T15499
      
      Reviewers: simonpj, bgamari
      
      Reviewed By: simonpj
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #15499
      
      Differential Revision: https://phabricator.haskell.org/D5060
      
      (cherry picked from commit 63b6a1d4)
      0af55c12
    • Tamar Christina's avatar
      Drop accidental write-attributes request · a2e3334c
      Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      The new filesystem code accidentally asks for write attributes
      permissions when doing read-only access.
      
      I believe this is what's causing the GHC 8.6.1 tarballs to fail
      when installed to a privileged location.
      I haven't been able to reproduce the issue yet, but this permission
      bit is wrong anyway.
      
      Test Plan: I'm still trying to workout how to test that this works,
      changing the permissions on the folder doesn't seem to reproduce
      the error on a tarball I made from before the change.
      
      Reviewers: bgamari, tdammers
      
      Reviewed By: bgamari
      
      Subscribers: tdammers, monoidal, rwbarton, carter
      
      GHC Trac Issues: #15667
      
      Differential Revision: https://phabricator.haskell.org/D5177
      
      (cherry picked from commit deceb21b)
      a2e3334c
    • Ben Gamari's avatar
      Bump array submodule · bf256ef2
      Ben Gamari authored
      bf256ef2
    • Kavon Farvardin's avatar
      Multiple fixes / improvements for LLVM backend · 73273be4
      Kavon Farvardin authored and Ben Gamari's avatar Ben Gamari committed
      - Fix for #13904 -- stop "trashing" callee-saved registers, since it is
        not actually doing anything useful.
      
      - Fix for #14251 -- fixes the calling convention for functions passing
        raw SSE-register values by adding padding as needed to get the values
        in the right registers. This problem cropped up when some args were
        unused an dropped from the live list.
      
      - Fixed a typo in 'readnone' attribute
      
      - Added 'lower-expect' pass to level 0 LLVM optimization passes to
        improve block layout in LLVM for stack checks, etc.
      
      Test Plan: `make test WAYS=optllvm` and `make test WAYS=llvm`
      
      Reviewers: bgamari, simonmar, angerman
      
      Reviewed By: angerman
      
      Subscribers: rwbarton, carter
      
      GHC Trac Issues: #13904, #14251
      
      Differential Revision: https://phabricator.haskell.org/D5190
      
      (cherry picked from commit adcb5fb4)
      73273be4
    • Ben Gamari's avatar
      testsuite: Don't force run of llvm ways in T14251 · 4338398f
      Ben Gamari authored
      This breaks if LLVM is not available.
      
      (cherry picked from commit d0d74842)
      4338398f
    • Ben Gamari's avatar
      Add testcase for #14251 · 94cadce6
      Ben Gamari authored
      (cherry picked from commit ba086ca7)
      94cadce6
  8. Sep 21, 2018
  9. Sep 20, 2018
  10. Sep 19, 2018
  11. Sep 18, 2018
Loading