summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add note documenting refineDefaultAltMatthew Pickering2018-05-131-0/+88
| | | | | | | | | | Reviewers: sjakobi, bgamari Reviewed By: sjakobi Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4687
* Clarify what the FFI spec saysDavid Feuer2018-05-131-10/+16
| | | | | | | | | | | | | | | | | | | | | Section 10.1.1 claimed that > The FFI addendum stipulates that an implementation is free to implement an unsafe call by performing a safe call ... Reading through the FFI addendum (and the Haskell 2010 Report, which integrates it), I see no such stipulation. I think this explains the situation a bit better. [ci skip] Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter Differential Revision: https://phabricator.haskell.org/D4656
* GHCi: Include a note in the hint to expose a hidden packageChaitanya Koparkar2018-05-137-1/+14
| | | | | | | | | | | | | | Test Plan: validate Reviewers: bgamari, RyanGlScott, osa1 Reviewed By: bgamari Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15055 Differential Revision: https://phabricator.haskell.org/D4669
* rts: Compile with gcc -OgBen Gamari2018-05-132-2/+2
| | | | | | | | | | | | | | | This optimisation level is specifically designed to provide the benefits of optimisation without the obfuscation that sometimes results. Test Plan: Validate Reviewers: simonmar Reviewed By: simonmar Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4675
* Remove unused things from utils/DigraphDavid Feuer2018-05-131-89/+2
| | | | | | | | | | | | | | | | | `utils/Digraph` had a bunch of code that wasn't actually being used, much of which wasn't documented at all, some of which was clearly ill-considered, and some of which was documented as being inefficient. Remove all unused code from that module except for the obvious and innocuous `emptyG`. Reviewers: bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4676
* Fix changelog message for asinhDavid Feuer2018-05-131-2/+2
| | | | | | | | | | Reviewers: bgamari, hvr Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4678
* Fix a few GCC warningsMichal Terepeta2018-05-136-14/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC 8 now generates warnings for incompatible function pointer casts [-Werror=cast-function-type]. Apparently there are a few of those in rts code, which makes `./validate` unhappy (since we compile with `-Werror`) This commit tries to fix these issues by changing the functions to have the correct type (and, if necessary, moving the casts into those functions). For instance, hash/comparison function are declared (`Hash.h`) to take `StgWord` but we want to use `StgWord64[2]` in `StaticPtrTable.c`. Instead of casting the function pointers, we can cast the `StgWord` parameter to `StgWord*`. I think this should be ok since `StgWord` should be the same size as a pointer. Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com> Test Plan: ./validate Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4673
* Refactor LitStringSylvain Henry2018-05-137-82/+85
| | | | | | | | | | | | | | | | | | Refactor LitString so that the string length is computed at most once and then stored. Also remove strlen and memcmp wrappers (it seems like they were a workaround for a very old GCC when using -fvia-C). Bumps haddock submodule. Reviewers: bgamari, dfeuer, nickkuk Reviewed By: bgamari, nickkuk Subscribers: nickkuk, dfeuer, thomie, carter Differential Revision: https://phabricator.haskell.org/D4630
* Bump array submoduleBen Gamari2018-05-131-0/+0
|
* TcInteract: Ensure that tycons have representations before solving for TypeableBen Gamari2018-05-136-6/+13
| | | | | | | | | | | | Summary: This fixes #15067. Test Plan: Validate Subscribers: thomie, carter, RyanGlScott GHC Trac Issues: #15067 Differential Revision: https://phabricator.haskell.org/D4623
* base: Fix handling of showEFloat (Just 0)Ben Gamari2018-05-133-21/+34
| | | | | | | | | | | | | | | | | | | | Previously `showEFloat (Just 0) pi ""` would produce `3.0e0`. Of course, this blatantly disrespects the user's request to print with zero digits of precision. Fix this. This is tested by base's `num008` testcase. Test Plan: Validate Reviewers: hvr Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15115 Differential Revision: https://phabricator.haskell.org/D4665
* Simplify -ddump-json implementationMatthew Pickering2018-05-135-90/+27
| | | | | | | | | | | | | | | | | | | This patch takes the much simpler route of whenever the compiler tries to output something. We just dump a JSON document there and then. I think this should be sufficient to work with and anything more refined quickly got complicated as it was necessary to demarcate message scopes and so on. Reviewers: bgamari, dfeuer Reviewed By: bgamari Subscribers: Phyx, dfeuer, rwbarton, thomie, carter GHC Trac Issues: #14078 Differential Revision: https://phabricator.haskell.org/D4532
* Emit info-level log message when package envs are loadedHerbert Valerio Riedel2018-05-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | A common complaint with the new package environment files feature is that it's not obvious when package environments have been picked up. This patch applies the same strategy that was already used for `.ghci` files (which exhibit similar potential for confusion, c.f. #11389) to package environment files. For instance, this new notification looks like below for a GHCi invocation which loads both, a GHCi configuration as well as a package environment: GHCi, version 8.5.20180512: http://www.haskell.org/ghc/ :? for help Loaded package environment from /tmp/parsec-3.1.13.0/.ghc.environment.x86_64-linux-8.5.20180512 Loaded GHCi configuration from /home/hvr/.ghci Prelude> Addresses #15145 Reviewed By: bgamari, angerman GHC Trac Issues: #15145 Differential Revision: https://phabricator.haskell.org/D4689
* Use correct source spans for EmptyCaseRyan Scott2018-05-124-2/+38
| | | | | | | | | | | | | | | | | | | Summary: The parser's calculation of source spans for `EmptyCase` expressions was a bit off, leading to some wonky-looking error messages. Easily fixed with some uses of `comb3` and `sLL`. Test Plan: make test TEST=T15139 Reviewers: bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie, mpickering, carter GHC Trac Issues: #15139 Differential Revision: https://phabricator.haskell.org/D4685
* Revert "Fix unwinding of C -> Haskell FFI calls with -threaded"Bartosz Nitka2018-05-125-185/+28
| | | | | | This reverts commit cb5c2fe875965b7aedbc189012803fc62e48fb3f. It appears to have broken OSX and Windows builds.
* Adds CTRL-C handler in Windows's timeout (trac issue #12721)ARJANEN Loïc Jean David2018-05-121-23/+32
| | | | | | | | | | | | | | | | | | | Summary: Uses Win32's System.Win32.Console.CtrlHandler.withConsoleCtrlHandler to add to Windows's version of the timeout executable a CTRL-C/CTRL-BREAK handler which does the close IO port/kill job cleanup, just in case. Signed-off-by: ARJANEN Loïc Jean David <arjanen.loic@gmail.com> Reviewers: Phyx, bgamari Reviewed By: Phyx Subscribers: dfeuer, thomie, carter GHC Trac Issues: #12721 Differential Revision: https://phabricator.haskell.org/D4631
* Expand $tooldir in ghc --info outputAlp Mestanogullari2018-05-122-6/+13
| | | | | | | | | | | | | | | | | | | | | Summary: This requires adding an `sToolDir :: Maybe FilePath` field to Settings, since compilerInfo is pure and therefore needs to have all the information available in the DynFlags. This should fix #15101 and #15107. Test Plan: ./validate --fast Reviewers: Phyx, bgamari Reviewed By: Phyx Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15101, #15107 Differential Revision: https://phabricator.haskell.org/D4686
* Fix unwinding of C -> Haskell FFI calls with -threadedBartosz Nitka2018-05-115-28/+185
| | | | | | | | | | | | | See the new note. Test Plan: manual testing with patched gdb Reviewers: bgamari, simonmar, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4666
* BlockAlloc.c: reuse tail_of functionÖmer Sinan Ağacan2018-05-111-8/+7
|
* Revert "Add -fghci-leak-check to check for space leaks"Simon Marlow2018-05-108-96/+2
| | | | This reverts commit 5fe6aaa3756cda654374ebfd883fa8f064ff64a4.
* rts: remove unused round_up_to_mblocks functionÖmer Sinan Ağacan2018-05-101-9/+0
|
* Fix #15038Ömer Sinan Ağacan2018-05-1014-9/+518
| | | | | | | | | | | | | | | | | | | | | We introduce a new Id for unused pointer values in unboxed sums that is not CAFFY. Because the Id is not CAFFY it doesn't make non-CAFFY definitions CAFFY, fixing #15038. To make sure anything referenced by the new id will be retained we get a stable pointer to in on RTS startup. Test Plan: Passes validate Reviewers: simonmar, simonpj, hvr, bgamari, erikd Reviewed By: simonmar Subscribers: rwbarton, thomie, carter GHC Trac Issues: #15038 Differential Revision: https://phabricator.haskell.org/D4680
* Add -fghci-leak-check to check for space leaksSimon Marlow2018-05-098-2/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Space leaks in GHCi emerge from time to time and tend to come back again after they get fixed. This is an attempt to limit regressions by * adding a reliable detection for some classes of space leaks in GHCi * turning on leak checking for all GHCi tests in the test suite, so that we'll notice if the leak appears again. The idea for detecting space leaks is quite simple: * find some data that we expect to be GC'd later, make a weak pointer to it * when we expect the data to be dead, do a `performGC` and then check the status of the weak pointer. It would be nice to apply this trick to lots of things in GHC, e.g. ensuring that HsSyn is not retained after the desugarer, or ensuring that CoreSyn from the previous simplifier pass is not retained. Test Plan: validate Reviewers: bgamari, simonpj, erikd, niteria Subscribers: thomie, carter GHC Trac Issues: #15111 Differential Revision: https://phabricator.haskell.org/D4658
* Normalize the element type of ListPat, fix #14547HE, Tao2018-05-083-13/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The element type of `List` maybe a type family instacen, rather than a trivial type. For example in Trac #14547, ``` {-# LANGUAGE TypeFamilies, OverloadedLists #-} class Foo f where type It f foo :: [It f] -> f data List a = Empty | a :! List a deriving Show instance Foo (List a) where type It (List a) = a foo [] = Empty foo (x : xs) = x :! foo xs ``` Here the element type of `[]` is `It (List a)`, we should also normalize it as `a`. Test Plan: make test TEST="T14547" Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #14547 Differential Revision: https://phabricator.haskell.org/D4624
* Revert "Normalize the element type of ListPat, fix #14547"Ben Gamari2018-05-083-20/+1
| | | | This reverts commit 981bf4718de7daef7817a363ccc14030c2688632.
* Normalize the element type of ListPat, fix #14547Ben Gamari2018-05-083-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The element type of `List` maybe a type family instacen, rather than a trivial type. For example in Trac #14547, ``` {-# LANGUAGE TypeFamilies, OverloadedLists #-} class Foo f where type It f foo :: [It f] -> f data List a = Empty | a :! List a deriving Show instance Foo (List a) where type It (List a) = a foo [] = Empty foo (x : xs) = x :! foo xs ``` Here the element type of `[]` is `It (List a)`, we should also normalize it as `a`. Test Plan: make test TEST="T14547" Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #14547 Differential Revision: https://phabricator.haskell.org/D4624
* Revert "Normalize the element type of ListPat, fix #14547"Ben Gamari2018-05-083-20/+1
| | | | This reverts commit 361d23a8ebb44f5df5167306d7b98d8bd1724e06.
* users-guide: Move discussion MAX_PATH out of release notesBen Gamari2018-05-082-43/+55
| | | | | | | | | | | | | | | This discussion will be useful for users; move it into the users-guide proper. Also fixes a few typos noted by @Phyx. Test Plan: Read it Reviewers: Phyx Reviewed By: Phyx Subscribers: dfeuer, Phyx, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4420
* Simplify the kind checking for type/class declsSimon Peyton Jones2018-05-087-103/+165
| | | | | This patch deletes quite a bit of code, AND fixes Trac #15116.
* Used named fields for DataDeclRnSimon Peyton Jones2018-05-081-3/+6
|
* Small refactoring in ExitifySimon Peyton Jones2018-05-081-60/+73
| | | | | This refactoring was provoked by our conversation on Trac #14152. No change in behaviour.
* printStackChunk: recognise a few more ret framesÖmer Sinan Ağacan2018-05-061-0/+12
|
* testsuite: Bump T5631 expected allocationsBen Gamari2018-05-051-3/+4
| | | | This was failing on Darwin; I believe this is due to 33de71fa06d0.
* base/changelog: Note stabilization of asinh (#14927)Ben Gamari2018-05-051-0/+3
|
* Stable area hyperbolic sine for `Double` and `Float`.Justus Sagemüller2018-05-052-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | This function was unstable, in particular for negative arguments. https://ghc.haskell.org/trac/ghc/ticket/14927 The reason is that the formula `log (x + sqrt (1 + x*x))` is dominated by the numerical error of the `sqrt` function when x is strongly negative (and thus the summands in the `log` mostly cancel). However, the area hyperbolic sine is an odd function, thus the negative side can as well be calculated by flipping over the positive side, which avoids this instability. Furthermore, for _very_ big arguments, the `x*x` subexpression overflows. However, long before that happens, the square root is anyways completely dominated by that term, so we can neglect the `1 +` and get sqrt (1 + x*x) ≈ sqrt (x*x) = x and therefore asinh x ≈ log (x + x) = log (2*x) = log 2 + log x which does not overflow for any normal-finite positive argument, but perfectly matches the exact formula within the floating-point accuracy.
* Add hyperbolic functions to test of Float-inversesJustus Sagemüller2018-05-053-1/+16
| | | | | The area hyperbolic sine is currently broken, see https://ghc.haskell.org/trac/ghc/ticket/14927.
* Add test for invertability of `Floating` methods.Justus Sagemüller2018-05-053-0/+59
| | | | | | These functions have inverses only on part of the real line, but there they should be reliably inverted – that's basically the whole point of the functions like `asin`, `atan` etc..
* Add 'addWordC#' PrimOpSebastian Graf2018-05-0574-81/+175
| | | | | | | | | | | | | | | | | | | This is mostly for congruence with 'subWordC#' and '{add,sub}IntC#'. I found 'plusWord2#' while implementing this, which both lacks documentation and has a slightly different specification than 'addWordC#', which means the generic implementation is unnecessarily complex. While I was at it, I also added lacking meta-information on PrimOps and refactored 'subWordC#'s generic implementation to be branchless. Reviewers: bgamari, simonmar, jrtc27, dfeuer Reviewed By: bgamari, dfeuer Subscribers: dfeuer, thomie, carter Differential Revision: https://phabricator.haskell.org/D4592
* Use unsafeInsertNew to create timers in TimerManagerMitchell Rosen2018-05-052-18/+5
|
* Do not supply `-mcpu` if `-optlc` provides `-mcpu` already.Moritz Angermann2018-05-051-2/+3
| | | | | | | | | | Reviewers: bgamari Subscribers: thomie, carter GHC Trac Issues: #14982 Differential Revision: https://phabricator.haskell.org/D4548
* testsuite: Add test for #15067Ben Gamari2018-05-053-0/+24
| | | | | | | | Subscribers: thomie, carter, RyanGlScott GHC Trac Issues: #15067 Differential Revision: https://phabricator.haskell.org/D4622
* Normalize the element type of ListPat, fix #14547HE, Tao2018-05-053-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The element type of `List` maybe a type family instacen, rather than a trivial type. For example in Trac #14547, ``` {-# LANGUAGE TypeFamilies, OverloadedLists #-} class Foo f where type It f foo :: [It f] -> f data List a = Empty | a :! List a deriving Show instance Foo (List a) where type It (List a) = a foo [] = Empty foo (x : xs) = x :! foo xs ``` Here the element type of `[]` is `It (List a)`, we should also normalize it as `a`. Test Plan: make test TEST="T14547" Reviewers: bgamari Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #14547 Differential Revision: https://phabricator.haskell.org/D4624
* Split TrieMap into a general (TrieMap) and core specific (CoreTrieMap) module.klebinger.andreas@gmx.at2018-05-058-370/+438
| | | | | | | | | | | | | | | | | | Splitting TrieMap into a general and core specific part allows us to define instances for TrieMap without creating a transitive dependency on CoreSyn. Test Plan: ci Reviewers: goldfire, bgamari, simonmar, simonpj Reviewed By: bgamari, simonpj Subscribers: simonpj, nomeata, thomie, carter GHC Trac Issues: #15082 Differential Revision: https://phabricator.haskell.org/D4618
* rel-notes: Note that -hT is now allowedBen Gamari2018-05-051-0/+3
| | | | | | See #15086. [skip-ci]
* Fix typo in user guide about promoted listMasahiro Sakai2018-05-051-1/+1
| | | `:'` in explanation text should be `':` to match code example.
* Update docker images to use GHC 8.4.2 and cabal-install-2.2mrkkrp2018-05-054-30/+38
| | | | | | | The ‘haskell’ images are not being updated and there is no image with GHC 8.4.2, so we probably should not use them anymore. I adapted Dockerfiles used by those images so the end result is almost the same except we get newer GHC and cabal-install.
* testsuite: Bump T9630 allocations as a result of 33de71fa06d0Ben Gamari2018-05-051-1/+2
| | | | | | This patch made the simplifier inline nested function bindings less aggressively and, while it didn't seem to affect nofib, appears to have regressed T9630 rather considerably.
* Simplify callSiteInline a littleSimon Peyton Jones2018-05-041-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has virtually no effect on anything (according to a nofib run). But it simplifies the definition of interesting_call by being a bit less gung-ho about inlining nested function bindings. See Note [Nested functions] ----------------------------------------------------------------------- Program Size Allocs Runtime Elapsed TotalMem ----------------------------------------------------------------------- anna +0.2% -0.0% 0.163 0.163 0.0% binary-trees +0.1% +0.0% -4.5% -4.5% 0.0% cacheprof -0.1% +0.1% -4.7% -4.8% +2.7% fasta +0.2% 0.0% +2.6% +3.0% 0.0% fluid -0.0% -0.6% 0.011 0.011 0.0% gamteb -0.1% -0.0% 0.069 0.070 0.0% hpg +0.1% +0.0% +0.7% +0.7% 0.0% infer +0.3% +0.2% 0.097 0.098 0.0% lambda -0.1% -0.0% +2.0% +2.0% 0.0% n-body +0.1% -0.1% -0.1% -0.1% 0.0% simple -0.2% -0.2% +0.6% +0.6% 0.0% spectral-norm +0.1% -0.0% -0.1% -0.1% 0.0% tak -0.0% -0.1% 0.024 0.024 0.0% -------------------------------------------------------------------------------- Min -0.4% -0.6% -5.3% -5.3% 0.0% Max +0.3% +0.2% +3.3% +3.3% +15.0% Geometric Mean -0.0% -0.0% -0.3% -0.3% +0.2%
* Normalize T14999 test output some moreBartosz Nitka2018-05-042-5/+2
| | | | | | @osa1 reported that the output on his machine has extra newlines: https://phabricator.haskell.org/D4606#129092. This collapses consecutive newlines.
* Enable warning flags to safe-guard against regressions in `base`Herbert Valerio Riedel2018-05-031-0/+3
| | | | | | | | | | Test Plan: via CI Reviewers: bgamari Subscribers: dfeuer, thomie, carter Differential Revision: https://phabricator.haskell.org/D4640