summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Testsuite fixeswip/backports-9.0Ben Gamari2021-08-043-4/+24
| | | | These tests were originally written against the GHC2021 language.
* Unify remaining GHCi prompt exampleEmily Martins2021-08-041-1/+1
| | | | | Signed-off-by: Emily Martins <emily.flakeheart@gmail.com> (cherry picked from commit 05ae47721d05cd35b7a67dac054f0ab483a4ca28)
* Unify primary and secondary GHCi promptEmily Martins2021-08-042-16/+16
| | | | | | | | Fixes #20042 Signed-off-by: Emily Martins <emily.flakeheart@gmail.com> Signed-off-by: Hécate Moonlight <hecate@glitchbra.in> (cherry picked from commit d455c39e93881dc3810ecc16a2f1bfd6c4e2fcdd)
* ci: fix ci.sh by creating build.mk in one placeAdam Sandberg Ericsson2021-08-041-21/+3
| | | | | | | | | | | | | Previously `prepare_build_mk` created a build.mk that was overwritten right after. This makes the BIGNUM_BACKEND choice take effect, fixing #19953, and causing the metric increase below in the integer-simple job. Metric Increase: space_leak_001 (cherry picked from commit 87f57ecf2523e83d8dd9cad919a6f2010f630ad0)
* Detect underflow in fromIntegral/Int->Natural ruleSylvain Henry2021-08-044-3/+29
| | | | | | Fix #20066 (cherry picked from commit a820f9002d8f75385aaaa141ac3c6f001e8a9874)
* Fix desugaring with unboxed types (#19883)Krzysztof Gogolewski2021-08-043-1/+21
| | | | (cherry picked from commit 4023d4d96a9492eb686883539153b2be7d23e1c7)
* rts: move xxxHash out of the user namespaceTamar Christina2021-08-044-7/+25
| | | | (cherry picked from commit 74c874148fbea996cadf1d9fa50f2a44488dd82b)
* PPC NCG: Fix unsigned compare with 16-bit constantsPeter Trommler2021-08-041-1/+2
| | | | | | Fixes #19852 and #19609 (cherry picked from commit 6a577cf0edb38577e703c9523a4307ae9fa7576d)
* Do not reassociate lexical negation (#19838)Vladislav Zavialov2021-08-043-11/+27
| | | | (cherry picked from commit 3f60a7e59dc5e067a3c764799478645dbc37700d)
* Optimiser: Correctly deal with strings starting with unicode characters in ↵Matthew Pickering2021-08-043-21/+30
| | | | | | | | | | | | | | | | | | | | | | exprConApp_maybe For example: "\0" is encoded to "C0 80", then the rule would correct use a decoding function to work out the first character was "C0 80" but then just used BS.tail so the rest of the string was "80". This resulted in "\0" being transformed into '\C0\80' : unpackCStringUTF8# "80" Which is obviously bogus. I rewrote the function to call utf8UnconsByteString directly and avoid the roundtrip through Faststring so now the head/tail is computed by the same call. Fixes #19976 (cherry picked from commit 7f6454fb8cd92b2b2ad4e88fa6d81e34d43edb9a)
* rts: Eliminate redundant branchGHC GitLab CI2021-08-041-3/+1
| | | | | | | | Previously we branched unnecessarily on IF_NONMOVING_WRITE_BARRIER_ENABLED on every trip through the array barrier push loop. (cherry picked from commit 30f233fe8a0342abbafa2b785a32615bace9492f)
* codeGen: Fix header size for array write barriersGHC GitLab CI2021-08-041-3/+3
| | | | | | | | | | | Previously the code generator's logic for invoking the nonmoving write barrier was inconsistent with the write barrier itself. Namely, the code generator treated the header size argument as being in words whereas the barrier expected bytes. This was the cause of #19715. Fixes #19715. (cherry picked from commit 221a104f44fdf58e4514d41ae827747c2bf938c8)
* RTS: try to fix timer racesSylvain Henry2021-08-042-2/+5
| | | | | | | | | | | | | | | | | | * Pthread based timer was initialized started while some other parts of the RTS assume it is initialized stopped, e.g. in hs_init_ghc: /* Start the "ticker" and profiling timer but don't start until the * scheduler is up. However, the ticker itself needs to be initialized * before the scheduler to ensure that the ticker mutex is initialized as * moreCapabilities will attempt to acquire it. */ * after a fork, don't start the timer before the IOManager is initialized: the timer handler (handle_tick) might call wakeUpRts to perform an idle GC, which calls wakeupIOManager/ioManagerWakeup Found while debugging #18033/#20132 but I couldn't confirm if it fixes them.
* [aarch64-macho] Fix off-by-one error in the linkerMoritz Angermann2021-08-041-1/+11
| | | | | | | | We need to be careful about the sign bit for BR26 relocation otherwise we end up encoding a large positive number and reading back a large negative number. (cherry picked from commit d6ab9c60288369ec991826b158d751dd4cb3319e)
* gitlab-ci: Bump ci-images revisionBen Gamari2021-08-041-1/+1
|
* Avoid fingerprinting the absolute path to the source filePepe Iborra2021-08-0411-8/+96
| | | | | | | | | | | | | | | | | | | | | | | | | This change aims to make source files relocatable w.r.t. to the interface files produced by the compiler. This is so that we can download interface files produced by a cloud build system and then reuse them in a local ghcide session catch another case of implicit includes actually use the implicit quote includes add another missing case recomp020 test that .hi files are reused even if .hs files are moved to a new location Added recomp021 to record behaviour with non implicit includes add a note additional pointer to the note Mention #16956 in Note (cherry picked from commit 9faafb0aaff04e86a58b9e108f84618b12f2057c)
* Make setBndrsDemandInfo work with only type variablesMatthew Pickering2021-08-043-3/+15
| | | | | | | Fixes #19849 Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> (cherry picked from commit c4099b0908e3f4ae04312ca82af147eb1585cd09)
* Bignum: bump to version 1.1 (#19846)Sylvain Henry2021-08-042-1/+11
| | | | (cherry picked from commit df4a0a53691cd833f54eb443401243dd9c964196)
* Report actual port in libiserv:Remote.Slave.startSlaveFacundo Domínguez2021-08-041-1/+2
| | | | | | | | This allows to start iserv by passing port 0 to startSlave, which in turns allows to get an available port when no port is known to be free a priori. (cherry picked from commit b39dec86df8106a2bb4770758941572073ad57a2)
* CPR: Detect constructed products in `runRW#` apps (#19822)Sebastian Graf2021-06-037-26/+81
| | | | | | | | | | | | | | | | | | | | | | | In #19822, we realised that the Simplifier's new habit of floating cases into `runRW#` continuations inhibits CPR analysis from giving key functions of `text` the CPR property, such as `singleton`. This patch fixes that by anticipating part of !5667 (Nested CPR) to give `runRW#` the proper CPR transformer it now deserves: Namely, `runRW# (\s -> e)` should have the CPR property iff `e` has it. The details are in `Note [Simplification of runRW#]` in GHC.CoreToStg.Prep. The output of T18086 changed a bit: `panic` (which calls `runRW#`) now has `botCpr`. As outlined in Note [Bottom CPR iff Dead-Ending Divergence], that's OK. Fixes #19822. Metric Decrease: T9872d (cherry picked from commit b0df2f012ede2f9017577198b5285ca6015b582b)
* Include mman.h before disabling non-POSIX headersViktor Dukhovni2021-06-031-0/+12
| | | | (cherry picked from commit 398994e19699f788a7810b4044e7aa817a10e73e)
* Bignum: match on DataCon workers in rules (#19892)Sylvain Henry2021-06-016-19/+62
| | | | | | | | | | | We need to match on DataCon workers for the rules to be triggered. T13701 ghc/alloc decreases by ~2.5% on some archs Metric Decrease: T13701 (cherry picked from commit 2d9c806988ac6027930f25801f1cce080df3b037)
* Improve wording of fold[lr]M documentation.Viktor Dukhovni2021-05-291-74/+98
| | | | | | | | | | | | | | | | | - Also replace `name'` with 'name''. The latter works more consistently. The sequencing of monadic effects in foldlM and foldrM was described as respectively right-associative and left-associative, but this could be confusing, as in essence we're just composing Kleisli arrows, whose composition is simply associative. What matters therefore is the order of sequencing of effects, which can be described more clearly without dragging in associativity as such. This avoids describing these folds as being both left-to-right and right-to-left depending on whether we're tracking effects or operator application. The new text should be easier to understand.
* users-guide: Document deprecation of -funfolding-keeness-factorBen Gamari2021-05-121-0/+7
| | | | | | See #15304. (cherry picked from commit 3339ed49b103d5aab42733dfb434de3a9a27bf2b)
* Fix magicDict in ghci (and in the presence of other ticks)Matthew Pickering2021-05-129-2/+72
| | | | | | | | | | | | | The problem was that ghci inserts some ticks around the crucial bit of the expression. Just like in some of the other rules we now strip the ticks so that the rule fires more reliably. It was possible to defeat magicDict by using -fhpc as well, so not just an issue in ghci. Fixes #19667 and related to #19673 (cherry picked from commit 6974c9e478120f6c4eeb53ebfa935c30cafcdf8e)
* Eliminate unsafeEqualityProof in CorePrepSimon Peyton Jones2021-05-1223-221/+523
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main idea here is to avoid treating * case e of {} * case unsafeEqualityProof of UnsafeRefl co -> blah specially in CoreToStg. Instead, nail them in CorePrep, by converting case e of {} ==> e |> unsafe-co case unsafeEqualityProof of UnsafeRefl cv -> blah ==> blah[unsafe-co/cv] in GHC.Core.Prep. Now expressions that we want to treat as trivial really are trivial. We can get rid of cpExprIsTrivial. And we fix #19700. A downside is that, at least under unsafeEqualityProof, we substitute in types and coercions, which is more work. But a big advantage is that it's all very simple and principled: CorePrep really gets rid of the unsafeCoerce stuff, as it does empty case, runRW#, lazyId etc. I've updated the overview in GHC.Core.Prep, and added Note [Unsafe coercions] in GHC.Core.Prep Note [Implementing unsafeCoerce] in base:Unsafe.Coerce We get 3% fewer bytes allocated when compiling perf/compiler/T5631, which uses a lot of unsafeCoerces. (It's a happy-generated parser.) Metric Decrease: T5631 (cherry picked from commit 6c7fff0b6f9514d6572cbe6bbfa4aafc259caebe)
* rts/m32: Fix bounds checkBen Gamari2021-05-121-3/+4
| | | | | | | | | | Previously we would check only that the *start* of the mapping was in the bottom 32-bits of address space. However, we need the *entire* mapping to be in low memory. Fix this. Noticed by @Phyx. (cherry picked from commit 72c1812feecd2aff2a96b629063ba90a2f4cdb7b)
* Disallow -XDerivingVia when -XSafe is on (#19786)Aaron Allen2021-05-124-1/+23
| | | | | | | Since `GeneralizedNewtypeDeriving` is considered unsafe, `DerivingVia` should be as well. (cherry picked from commit 0281dae8b3fe3384939c415ae72ca2440b3cafb3)
* testsuite: Add test for #19645Ben Gamari2021-05-123-0/+31
| | | | (cherry picked from commit 9f9fab1531d62f6d30c853722548393be264120b)
* codeGen: Teach unboxed sum rep logic about levityBen Gamari2021-05-124-36/+81
| | | | | | | | | | | | | | | | Previously Unarise would happily project lifted and unlifted fields to lifted slots. This broke horribly in #19645, where a ByteArray# was passed in a lifted slot and consequently entered. The simplest way to fix this is what I've done here, distinguishing between lifted and unlifted slots in unarise. However, one can imagine more clever solutions, where we coerce the binder to the correct levity with respect to the sum's tag. I doubt that this would be worth the effort. Fixes #19645. (cherry picked from commit 721ea018712606b9feddf09c130552ed981b4900)
* Bignum: add BigNat Eq/Ord instances (#19647)Sylvain Henry2021-05-121-0/+16
| | | | (cherry picked from commit a951e06921f05df1601d9c3a39efcede27f3330c)
* Introduce -ddump-verbose-inliningsBen Gamari2021-05-124-6/+15
| | | | | | | | Previously -ddump-inlinings and -dverbose-core2core used in conjunction would have the side-effect of dumping additional information about all inlinings considered by the simplifier. However, I have sometimes wanted this inlining information without the firehose of information produced by -dverbose-core2core. Introduce a new dump flag for this purpose.
* CmmToLlvm: Declare signature for memcmpMoritz Angermann2021-05-062-2/+18
| | | | | | Otherwise `opt` fails with: error: use of undefined value '@memcmp$def'
* Chiral foldable caveatsViktor Dukhovni2021-05-041-3/+71
| | | | Also nested foldr example for `concat`.
* Fix pthread_setname_np in itimer for DarwinViktor Dukhovni2021-04-272-4/+34
| | | | | _POSIX_SOURCE is too strict, we need _DARWIN_C_SOURCE, otherwise <pthread.h> does not expose pthread_setname_np(3).
* Block signals in the ticker threadViktor Dukhovni2021-04-233-13/+102
| | | | | | | | This avoids surprises in the non-threaded runtime with blocked signals killing the process because they're only blocked in the main thread and not in the ticker thread. Also backport improved compile-time detection of pthread_setname_np() and/or
* Fixes to dealing with the export of mainwip/T19397-backportSimon Peyton Jones2021-04-1647-395/+516
| | | | | | | | | | | | | | | | | | | | It's surprisingly tricky to deal with 'main' (#19397). This patch does quite bit of refactoring do to it right. Well, more-right anyway! The moving parts are documented in GHC.Tc.Module Note [Dealing with main] Some other oddments: * Rename tcRnExports to rnExports; no typechecking here! * rnExports now uses checkNoErrs rather than failIfErrsM; the former fails only if rnExports itself finds errors * Small improvements to tcTyThingCategory, which ultimately weren't important to the patch, but I've retained as a minor improvement.
* gitlab-ci: Build releases with hyperlinked sourcesBen Gamari2021-04-131-5/+4
| | | | | | Fixes #19455. (cherry picked from commit 8e3f736d96aaf008e2058754e34bef89ba8c8661)
* Enforce maximum happy/alex versionBen Gamari2021-04-091-12/+12
| | | | | This isn't necessary for `master` but will be backported to ghc-9.0 and will likely be useful in the future.
* users-guide: Document deprecation of -funfolding-keeness-factorBen Gamari2021-04-082-8/+10
| | | | See #15304.
* ci.sh: Factor out common utilitiesBen Gamari2021-04-082-47/+55
| | | | (cherry picked from commit dd6640316865d84075b00013b8b97076705e5c44)
* hadrian: Fix leakage of GHC in PATH into buildBen Gamari2021-04-081-1/+7
| | | | | | | | Previously hadrian would use GHC on PATH when configuring packages (or fail if there is no such GHC). Fix this. Unfortunately this runs into another bug in Cabal which we workaround. (cherry picked from commit 4ce9fe88e7e98178d5fd6b18ac9cba666a1f8306)
* gitlab-ci: Bump Docker imagesBen Gamari2021-04-075-51/+93
| | | | | | | We now generate our Docker images via Dhall definitions, as described in ghc/ci-images!52. Additionally, we are far more careful about where tools come from, using the ALEX, HAPPY, HSCOLOR, and GHC environment variables (set in the Dockerfiles) to find bootstrapping tools.
* gitlab-ci: Disable utimensat in Darwin buildsBen Gamari2021-04-071-0/+2
| | | | | | Fixes #17895. (cherry picked from commit ede60537b9c6827063734312d8068a7d30b89dd5)
* Add missing .hi-boot dependencies with ghc -M (#14482)Sylvain Henry2021-04-0710-2/+72
| | | | (cherry picked from commit 18e106a8dfdae50c3078558382209f53794a8c97)
* rts: stats: Fix calculation for fragmentationDouglas Wilson2021-04-071-1/+1
| | | | (cherry picked from commit 06beed685a69ed044159707363a791fd266f069b)
* rts: stats: Some fixes to stats for sequential gcsDouglas Wilson2021-04-072-14/+37
| | | | | | | | | | Solves #19147. When n_capabilities > 1 we were not correctly accounting for gc time for sequential collections. In this case par_n_gcthreads == 1, however it is not guaranteed that the single gc thread is capability 0. A similar issue for copied is addressed as well. (cherry picked from commit f49d6fb27336297d6d7a46269a22dd98c131b4a8)
* base: Fix since-annotation for Data.List.singletonSimon Jakobi2021-04-071-1/+1
| | | | (cherry picked from commit 9b7dcd80f16efda57e4e51e39d61b55a11c72014)
* rts/Linker: Add noreturn to loadNativeObj on non-ELF platformsBen Gamari2021-04-071-2/+6
| | | | (cherry picked from commit 16a69eafc35eabd1cf579187e980eab685e1d2e1)
* Fix assertion error with linear types, #19400Krzysztof Gogolewski2021-04-073-10/+24
| | | | | | | The previous code using TyCoMapper could promote the same metavar twice. Use a set instead. (cherry picked from commit b8d40af138fe0f7fad9b6afafe2152d8213a3e25)