1. 22 Nov, 2018 35 commits
    • Alec Theriault's avatar
      Simplify 'ExtBits' in the lexer · d2fbc33c
      Alec Theriault authored
      The main change is to export 'ExtBits' instead of defining/exporting a
      bunch of boilerplate functions that test for a particular 'ExtBits'.
      In the process, I also
        * cleaned up an unneeded special case for 'ITstatic'
        * made 'UsePosPrags' another variant of 'ExtBits'
        * made the logic in 'reservedSymsFM' match that of 'reservedWordsFM'
      Test Plan: make test
      Reviewers: bgamari, alanz
      Subscribers: sjakobi, rwbarton, mpickering, carter
      Differential Revision: https://phabricator.haskell.org/D5332
    • Alec Theriault's avatar
      'DynFlag'-free version of 'mkParserFlags' · 5aa29231
      Alec Theriault authored
      Obtaining a `DynFlags` is difficult, making using the lexer/parser
      for pure parsing/lexing unreasonably difficult, even with
      This is despite the fact that we only really need
        * language extension flags
        * warning flags
        * a handful of boolean options
      The new `mkParserFlags'` function makes is easier to directly construct
      a `ParserFlags`. Furthermore, since `pExtsBitmap` is just a footgun,
      I've gone ahead and made `ParserFlags` an abstract type.
      Reviewers: bgamari, alanz, sjakobi
      Reviewed By: bgamari, sjakobi
      Subscribers: mpickering, sjakobi, rwbarton, carter
      GHC Trac Issues: #11301
      Differential Revision: https://phabricator.haskell.org/D5269
    • Alec Theriault's avatar
      Doc-only fixes · a1bbb56f
      Alec Theriault authored
      * laws are capitalized definition lists, no emphasis on the labels
      * adds missing hyperlinks
      * fixes other misc. Haddock markup issues.
    • Peter Trommler's avatar
    • Dario Bertini's avatar
    • Dario Bertini's avatar
      rts/MachO: A bit of refactoring in ocGetNames · b2f6f896
      Dario Bertini authored
      Eliminates a bit of repetition.
    • Dario Bertini's avatar
    • Dario Bertini's avatar
      circleci: Actually build with in-tree GMP on Darwin · 3584bd42
      Dario Bertini authored
      Fixes #15404.
    • Gabor Greif's avatar
      llvmGen: Eliminate duplicate definition · d0fc7618
      Gabor Greif authored
      remove local
    • Jessica Clarke's avatar
      UNREG: PprC: Add support for adjacent floats · 35a89778
      Jessica Clarke authored
      When two 32-bit floats are adjacent for a 64-bit target, there is no
      padding between them to force alignment, so we must combine their bit
      representations into a single word.
      Reviewers: bgamari, simonmar
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15853
      Differential Revision: https://phabricator.haskell.org/D5306
    • Ryan Scott's avatar
      Overhaul -fprint-explicit-kinds to use VKA · f5d20838
      Ryan Scott authored
      This patch changes the behavior of `-fprint-explicit-kinds`
      so that it displays kind argument using visible kind application.
      In other words, the flag now:
      1. Prints instantiations of specified variables with `@(...)`.
      2. Prints instantiations of inferred variables with `@{...}`.
      In addition, this patch removes the `Use -fprint-explicit-kinds to
      see the kind arguments` error message that often arises when a type
      mismatch occurs due to different kinds. Instead, whenever there is a
      kind mismatch, we now enable the `-fprint-explicit-kinds` flag
      locally to help cue to the programmer where the error lies.
      (See `Note [Kind arguments in error messages]` in `TcErrors`.)
      As a result, these funny `@{...}` things can now appear to the user
      even without turning on the `-fprint-explicit-kinds` flag explicitly,
      so I took the liberty of documenting them in the users' guide.
      Test Plan: ./validate
      Reviewers: goldfire, simonpj, bgamari
      Reviewed By: simonpj
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15871
      Differential Revision: https://phabricator.haskell.org/D5314
    • Alec Theriault's avatar
      Hadrian: Misc. fixes in Haddock rules · ff619555
      Alec Theriault authored
      * Pass 'GHC/Prim.hs' to Haddock when processing 'ghc-prim'. This
        file is autogenerated for the sole purpose of giving Haddock
        something to process, so we really should make sure it gets
        through to Haddock!
      * Add a "docs-haddock" build rule, which should build all Haddock docs
        that the Makefile builds by default (all libs + index for libs + ghc)
      * Prune some unnecessary rules (esp. `gen_contents_index`)
      Reviewers: bgamari, snowleopard
      Reviewed By: snowleopard
      Subscribers: alpmestan, snowleopard, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5316
    • Simon Jakobi's avatar
      Remove warnings-silencing flags for code generated by Alex · 699e5072
      Simon Jakobi authored
      Current versions of Alex don't seem to produce as many warnings any
      In order to silence a warning and to avoid overlong lines, I've taken
      the liberty of refactoring 'tok_num'.
      Test Plan: ./validate
      Reviewers: bgamari, simonmar
      Reviewed By: simonmar
      Subscribers: erikd, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5319
    • Roland Senn's avatar
      Calling gcc: Pass optc flags as last options (#14452) · f2d9fb0c
      Roland Senn authored
      Test Plan: make test TEST=T14452
      Reviewers: hvr, bgamari, monoidal, thomie, osa1
      Reviewed By: osa1
      Subscribers: rwbarton, carter
      GHC Trac Issues: #14452
      Differential Revision: https://phabricator.haskell.org/D5318
    • Ryan Scott's avatar
      Fix #15852 by eta expanding data family instance RHSes, too · 014d6c1f
      Ryan Scott authored
      When I defined `etaExpandFamInstLHS`, I blatantly forgot
      to eta expand the RHSes of data family instances. (Actually, I
      claimed that they didn't //need// to be eta expanded. I'm not sure
      what I was thinking.)
      This fixes the issue by changing `etaExpandFamInstLHS` to
      `etaExpandFamInst` and, well, making it actually eta expand the RHS.
      Test Plan: make test TEST=T15852
      Reviewers: goldfire, bgamari
      Reviewed By: goldfire
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15852
      Differential Revision: https://phabricator.haskell.org/D5328
    • Simon Jakobi's avatar
      Refactor TcRnMonad.mapAndRecoverM · 66f0056a
      Simon Jakobi authored
      This version doesn't require the 'reverse' step after the monadic
      Test Plan: ./validate
      Reviewers: bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: monoidal, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5343
    • Zejun Wu's avatar
      Fix uninformative hp2ps error when the cmdline contains double quotes · 390df8b5
      Zejun Wu authored
      The format of hp file didn't allow double quotes inside strings, and
      under prof build, we include args in JOB, which may have double quotes.
      When this happens, the error message is confusing to the user. This can
      also happen under normal build if the executable name contains double
      quite, which is unlikely though.
      We fix this issue by introducing escaping for double quotes inside a
      string by repeating it twice.
      We also fix a buffer overflow bug when the length of the string happen
      to be multiple of 5000.
      Test Plan:
      new tests, which used to fail with error message:
      hp2ps: "T15904".hp, line 2: integer must follow identifier
      use new ghc and hp2ps to profile a simple program.
      Reviewers: simonmar, bgamari, erikd
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15904
      Differential Revision: https://phabricator.haskell.org/D5346
    • Christiaan Baaij's avatar
      Load plugins in interactive session · 599eaada
      Christiaan Baaij authored
      Reviewers: bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: monoidal, rwbarton, carter
      GHC Trac Issues: #15633
      Differential Revision: https://phabricator.haskell.org/D5348
    • Zejun Wu's avatar
      Fix deadlock bug when mkFastStringWith is duplicated · f088c2d4
      Zejun Wu authored
      In D5211, we use `withMVar` to guard writes to the same segment, this
      is unsafe to be duplicated. It can lead to deadlock if it is only run
      partially and `putMVar` is not called after `takeMVar`.
      Test Plan:
      We used to see deadlock when building stackage without this fix, and it
      no longer happens.
      Reviewers: simonmar, bgamari
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5349
    • Christiaan Baaij's avatar
      plugins10 no longer broken · 1f74f7dd
      Christiaan Baaij authored
      Reviewers: bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15216
      Differential Revision: https://phabricator.haskell.org/D5350
    • Alp Mestanogullari's avatar
      rts.cabal.in: force inclusion of findPtr/_findPtr symbol only with debug flag · 561748cb
      Alp Mestanogullari authored
      The previous strategy caused problems on Windows, as pointed out
      at [1]
      [1]: https://phabricator.haskell.org/rGHC900c47f88784#133905
      Reviewers: Phyx, bgamari, erikd, simonmar
      Reviewed By: Phyx
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15671
      Differential Revision: https://phabricator.haskell.org/D5356
    • Alec Theriault's avatar
      Hadrian: work around Cabal's/GHC's different Arch/OS strings · 19ffddc1
      Alec Theriault authored
      The path to the 'include' subdirectory of 'rts' includes a folder that
      whose name is generated by Cabal and mentiones the architecture and OS.
      For example:
      Hadrian needs to be aware that Cabal renders architectures and OSes in
      a slightly different way than GHC. There is already symmetric logic in
      Cabal (for working with GHC environment files, which follow GHC's naming
      Test Plan: ./hadrian/build.sh -c "binary-dist" # on mac
      Reviewers: snowleopard, alpmestan, bgamari
      Reviewed By: snowleopard
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15922
      Differential Revision: https://phabricator.haskell.org/D5361
    • Tamar Christina's avatar
      rts: fix Windows megablock allocator · 676f1f2d
      Tamar Christina authored
      The megablock allocator does not currently check that after aligning the
      free region if it still has enough space to actually do the allocation.
      This causes it to return a memory region which it didn't fully allocate
      itself.  Even worse, it can cause it to return a block with a region
      that will be present in two allocation pools.
      This causes if you're lucky an error from the OS that you're committing
      memory that has never been reserved, or causes random heap corruption.
      This change makes it consider the alignment as well.
      Test Plan: ./validate , testcase testmblockalloc
      Reviewers: bgamari, erikd, simonmar
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5363
    • Simon Jakobi's avatar
      Don't reverse explicit export lists during renaming · 7cba71fc
      Simon Jakobi authored
      This will be useful for Hi Haddock / D5067.
      Previously any export list in 'tcg_rn_exports' would be in reverse
      Also remove a redundant setSrcSpan.
      Test Plan: ./validate
      Reviewers: bgamari
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5347
    • Andreas Klebinger's avatar
      Fixup the new code layout patch for SplitObjs. · 6c26b3f8
      Andreas Klebinger authored
      When splitting objects we sometimes generate
      dummy CmmProcs containing bottom in some fields.
      Code introduced in the new code layout patch looked
      at these which blew up the compiler. Now we instead
      check first if the function actually contains code.
      Reviewers: bgamari
      Subscribers: simonpj, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5357
    • Tamar Christina's avatar
      testuite: update more windows tests outputs · 67277e7c
      Tamar Christina authored
      Test Plan: ./validate
      Reviewers: bgamari, simonmar
      Subscribers: rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5362
    • Tamar Christina's avatar
      rts: Fix bss initialization on Windows · 06a09a5b
      Tamar Christina authored
      This patch fixes BSS initialization such that it is
      initialized to 0 as you'd expect.
      Test Plan: ./validate, test T7040_ghci
      Reviewers: bgamari, erikd, simonmar
      Reviewed By: bgamari
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15669
      Differential Revision: https://phabricator.haskell.org/D5364
    • Ben Gamari's avatar
      rts/M32Alloc: Abort if m32 linker mmap fails · 86f6890e
      Ben Gamari authored
      Previously we should just blinding dereference a NULL pointer.
    • Matthew Pickering's avatar
      Add test for #15437 · ea015172
      Matthew Pickering authored
      Reviewers: bgamari
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15437
      Differential Revision: https://phabricator.haskell.org/D5291
    • Ben Gamari's avatar
      base: Mention openFile throwing does-not-exist-errors on FIFOs · 4ba3fa31
      Ben Gamari authored
      As discussed in #15715, the POSIX specification specifies that
      attempting to open a FIFO in write-only mode when the FIFO has no
      readers will fail with -ENOENT.
      [skip ci]
      Test Plan: Read it
      Reviewers: hvr
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15715
      Differential Revision: https://phabricator.haskell.org/D5295
    • Krzysztof Gogolewski's avatar
      Fix GhostScript detection (Trac #15856) · 011e39d7
      Krzysztof Gogolewski authored
      The option `confdir` (used in GhostScript test) was set correctly
      via `--config` in `test.mk` and incorrectly via `config/ghc`.
      AFAICT, some time ago this was working because the
      incorrect assignment was done first, and later it broke.
      Hardian doesn't pass `confdir`. I removed `confdir` and use
      `config.top` to determine the directory of the
      `good.ps` and `bad.ps` files. This is simpler.
      I also removed some redundant assignments in `config/ghc`.
      Test Plan: manually set config.have_profiling and make test
      Reviewers: bgamari
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15856
      Differential Revision: https://phabricator.haskell.org/D5298
    • Sylvain Henry's avatar
      Rename literal constructors · 13bb4bf4
      Sylvain Henry authored
      In a previous patch we replaced some built-in literal constructors
      (MachInt, MachWord, etc.) with a single LitNumber constructor.
      In this patch we replace the `Mach` prefix of the remaining constructors
      with `Lit` for consistency (e.g., LitChar, LitLabel, etc.).
      Sadly the name `LitString` was already taken for a kind of FastString
      and it would become misleading to have both `LitStr` (literal
      constructor renamed after `MachStr`) and `LitString` (FastString
      variant). Hence this patch renames the FastString variant `PtrString`
      (which is more accurate) and the literal string constructor now uses the
      least surprising `LitString` name.
      Both `Literal` and `LitString/PtrString` have recently seen breaking
      changes so doing this kind of renaming now shouldn't harm much.
      Reviewers: hvr, goldfire, bgamari, simonmar, jrtc27, tdammers
      Subscribers: tdammers, rwbarton, thomie, carter
      Differential Revision: https://phabricator.haskell.org/D4881
    • Ben Gamari's avatar
      users guide: We no longer build libraries with -split-objs · f5fbecc8
      Ben Gamari authored
      We now generally use split-sections instead.
    • Gabor Greif's avatar
      Minor performance optimisation · 8707911a
      Gabor Greif authored
      only concat once
    • Gabor Greif's avatar
      another minor refactoring · 4343d5af
      Gabor Greif authored
  2. 21 Nov, 2018 1 commit
    • Ömer Sinan Ağacan's avatar
      Fix heap corruption during stable name allocation · 691aa715
      Ömer Sinan Ağacan authored
      See #15906 for the problem. To fix we simply call `allocate()` instead of
      `ALLOC_PRIM()`. `allocate()` does not trigger GC when the nursery is full,
      instead it extends it.
      Test Plan:
      This validates. memo001 now passes with `-debug` compile parameter. I'll add
      another test that runs memo001 with `-debug` once I figure out how to use
      stdout files for multiple tests.
      Reviewers: simonmar, bgamari, erikd
      Reviewed By: simonmar
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15906
      Differential Revision: https://phabricator.haskell.org/D5342
  3. 20 Nov, 2018 1 commit
  4. 19 Nov, 2018 3 commits
    • Sebastian Graf's avatar
      Don't track free variables in STG syntax by default · 47bbc709
      Sebastian Graf authored
      Currently, `CoreToStg` annotates `StgRhsClosure`s with their set of non-global
      free variables.  This free variable information is only needed in the final
      code generation step (i.e. `StgCmm.codeGen`), which leads to transformations
      such as `StgCse` and `StgUnarise` having to maintain this information.
      This is tiresome and unnecessary, so this patch introduces a trees-to-grow-like
      approach that only introduces the free variable set into the syntax tree in the
      code gen pass, along with a free variable analysis on STG terms to generate
      that information.
      Fixes #15754.
      Reviewers: simonpj, osa1, bgamari, simonmar
      Reviewed By: osa1
      Subscribers: rwbarton, carter
      GHC Trac Issues: #15754
      Differential Revision: https://phabricator.haskell.org/D5324
    • Alp Mestanogullari's avatar
      hadrian: make it possible to run the testsuite with quickest and quick · cc615c69
      Alp Mestanogullari authored
      More generally, we so far assumed that the testsuite would be executed
      with a flavour that's as comprehensive as perf in terms of available RTS
      and library flavours (at least vanilla + dynamic + prof). This would
      manifest itself concretely by needing 3 "ways" of the iserv program,
      We now only require the ways among vanilla, dynamic and prof that we
      can find in our current Flavour's rtsWays.
      Test Plan:
      hadrian/build.sh --flavour={quick, quickest} test now goes through
      (with a few failing tests, of course).
      Reviewers: bgamari, tdammers
      Reviewed By: tdammers
      Subscribers: mpickering, RyanGlScott, rwbarton, carter
      Differential Revision: https://phabricator.haskell.org/D5355
    • Matthew Pickering's avatar
      eventlog: Log the current stack size when stack overflows · 7e570676
      Matthew Pickering authored
      Reviewers: maoe, bgamari, erikd, simonmar
      Reviewed By: simonmar
      Subscribers: rwbarton, carter, sjorn3
      Differential Revision: https://phabricator.haskell.org/D5287