summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove confusing haddock quotes in 'readInt' documentationwip/read-int-docsMatthew Pickering2021-12-081-1/+1
| | | | | | | | | As pointed out in #20776, placing quotes in this way linked to the 'Integral' type class which is nothing to do with 'readInt', the text should rather just be "integral", to suggest that the argument must be an integer. Closes #20776
* Test-suite: fix geometric mean of empty listsheaf2021-12-031-2/+5
| | | | | | | The geometric mean computation panicked when it was given an empty list, which happens when there are no baselines. Instead, we should simply return 1.
* Revert "Data.List specialization to []"Matthew Pickering2021-12-0347-1464/+1694
| | | | | | | | | | This reverts commit bddecda1a4c96da21e3f5211743ce5e4c78793a2. This implements the first step in the plan formulated in #20025 to improve the communication and migration strategy for the proposed changes to Data.List. Requires changing the haddock submodule to update the test output.
* Require all dirty_MUT_VAR callers to do explicit stg_MUT_VAR_CLEAN_info ↵nineonine2021-12-023-12/+24
| | | | comparison (#20088)
* Make openFile more tolerant of async excs (#18832)Kamil Dworakowski2021-12-025-45/+96
|
* hadrian: Don't rely on realpath in bindist MakefileBen Gamari2021-12-023-4/+58
| | | | | | | | As noted in #19963, `realpath` is not specified by POSIX and therefore cannot be assumed to be available. Here we provide a POSIX shell implementation of `realpath`, due to Julian Ospald and others. Closes #19963.
* testsuite: Specify expected word-size of machop testsBen Gamari2021-12-021-7/+8
| | | | These generally expect a particular word size.
* CmmToC: Cast possibly-signed results as unsignedBen Gamari2021-12-021-10/+40
| | | | | | | C11 rule 6.3.1.1 dictates that all small integers used in expressions be implicitly converted to `signed int`. However, Cmm semantics require that the width of the operands be preserved with zero-extension semantics. For this reason we must recast sub-word arithmetic results as unsigned.
* CmmToC: Always cast arguments as unsignedBen Gamari2021-12-024-4/+33
| | | | | | | As noted in Note [When in doubt, cast arguments as unsigned], we must ensure that arguments have the correct signedness since some operations (e.g. `%`) have different semantics depending upon signedness.
* CmmToC: Zero-extend sub-word size resultsBen Gamari2021-12-021-6/+41
| | | | | As noted in Note [Zero-extending sub-word signed results] we must explicitly zero-extend the results of sub-word-sized signed operations.
* CmmToC: Fix width of shift operationsBen Gamari2021-12-021-3/+15
| | | | | Under C's implicit widening rules, the result of an operation like (a >> b) where a::Word8 and b::Word will have type Word, yet we want Word.
* nativeGen/aarch64: Fix handling of subword valuesBen Gamari2021-12-023-83/+228
| | | | | | | | | | | | | | | | Here we rework the handling of sub-word operations in the AArch64 backend, fixing a number of bugs and inconsistencies. In short, we now impose the invariant that all subword values are represented in registers in zero-extended form. Signed arithmetic operations are then responsible for sign-extending as necessary. Possible future work: * Use `CMP`s extended register form to avoid burning an instruction in sign-extending the second operand. * Track sign-extension state of registers to elide redundant sign extensions in blocks with frequent sub-word signed arithmetic.
* cmm/opt: Fold away shifts larger than shiftee widthBen Gamari2021-12-021-2/+12
| | | | | This is necessary for lint-correctness since we no longer allow such shifts in Cmm.
* nativeGen/aarch64: Don't rely on register width to determine amodeBen Gamari2021-12-021-12/+16
| | | | | We might be loading, e.g., a 16- or 8-bit value, in which case the register width is not reflective of the loaded element size.
* testsuite: Add testcases for various machop issuesBen Gamari2021-12-0211-0/+72
| | | | There were found by the test-primops testsuite.
* cmm: Disallow shifts larger than shifteeBen Gamari2021-12-022-0/+19
| | | | | | | | | | | | Previously primops.txt.pp stipulated that the word-size shift primops were only defined for shift offsets in [0, word_size). However, there was no further guidance for the definition of Cmm's sub-word size shift MachOps. Here we fix this by explicitly disallowing (checked in many cases by CmmLint) shift operations where the shift offset is larger than the shiftee. This is consistent with LLVM's shift operations, avoiding the miscompilation noted in #20637.
* ncg/aarch64: Don't sign extend loadsBen Gamari2021-12-021-2/+2
| | | | | Previously we would emit the sign-extending LDS[HB] instructions for sub-word loads. However, this is wrong, as noted in #20638.
* cmm: narrow when folding signed quotientsBen Gamari2021-12-021-2/+2
| | | | | | | | | | | | | | | | | | Previously the constant-folding behavior for MO_S_Quot and MO_S_Rem failed to narrow its arguments, meaning that a program like: %zx64(%quot(%lobits8(0x00e1::bits16), 3::bits8)) would be miscompiled. Specifically, this program should reduce as %lobits8(0x00e1::bits16) == -31 %quot(%lobits8(0x00e1::bits16), 3::bits8) == -10 %zx64(%quot(%lobits8(0x00e1::bits16), 3::bits8)) == 246 However, with this bug the `%lobits8(0x00e1::bits16)` would instead be treated as `+31`, resulting in the incorrect result of `75`. (cherry picked from commit 94e197e3dbb9a48991eb90a03b51ea13d39ba4cc)
* nativeGen/x86: Don't encode large shift offsetsBen Gamari2021-12-021-1/+10
| | | | | | | | | | | Handle the case of a shift larger than the width of the shifted value. This is necessary since x86 applies a mask of 0x1f to the shift amount, meaning that, e.g., `shr 47, $eax` will actually shift by 47 & 0x1f == 15. See #20626. (cherry picked from commit 31370f1afe1e2f071b3569fb5ed4a115096127ca)
* Use POSIX shell syntax to redirect stdout/errViktor Dukhovni2021-12-012-2/+2
| | | | | | | | FreeBSD (and likely NetBSD) /bin/sh does not support '>& word' to redirect stdout + stderr. (Also the preferred syntax in bash would be '&> word' to avoid surprises when `word` is "-" or a number). Resolves: #20760
* rts: Annotate benign race in pthread ticker's exit test Ben Gamari2021-12-011-0/+1
| | | | | | | | Previously TSAN would report spurious data races due to the unsynchronized access of `exited`. I would have thought that using a relaxed load on `exited` would be enough to convince TSAN that the race was intentional, but apparently not. Closes #20690.
* Factor our `$dir_$distdir_PKGDATA` make variableJohn Ericson2021-12-012-5/+7
| | | | This makes a few things cleaner.
* Avoid raw `echo` in `FPTOOLS_SET_PLATFORM_VARS`John Ericson2021-12-011-1/+1
| | | | This ensures quiet configuring works.
* Switch RTS cabal file / package conf to use Rts.h not Stg.hJohn Ericson2021-12-012-2/+2
| | | | | | | | | | | | | | | | | When we give cabal a configure script, it seems to begin checking whether or not Stg.h is valid, and then gets tripped up on all the register stuff which evidentally requires obscure command line flags to go. We can side-step this by making the test header Rts.h instead, which is more normal. I was a bit sketched out making this change, as I don't know why the Cabal library would suddenly beging checking the header. But I did confirm even without my RTS configure script the header doesn't compile stand-alone, and also the Stg.h is a probably-arbitrary choice since it dates all the way back to 2002 in 2cc5b907318f97e19b28b2ad8ed9ff8c1f401dcc.
* rts.cabal.in: Move `extra-source-files` so it is validJohn Ericson2021-12-011-4/+5
|
* Fix several quoting issues in testsuiteMatthew Pickering2021-12-014-7/+19
| | | | | | | | | This fixes the ./validate script on my machine. I also took the step to add some linters which would catch problems like these in future. Fixes #20506
* users-guide: Describe requirements of DWARF unwindingBen Gamari2021-12-011-0/+10
| | | | As requested in #20702
* testsuite: Print geometric mean of stat metricsBen Gamari2021-12-011-0/+14
| | | | As suggested in #20733.
* Add failing test for #20674Matthew Pickering2021-12-015-0/+36
|
* user-guide: Fix :since: of -XCApiFFIBen Gamari2021-12-011-1/+1
| | | | Closes #20504.
* hadrian: Document fully_static flavour transformerBen Gamari2021-12-011-0/+4
|
* ghc-compact: Update cabal fileBen Gamari2021-12-011-2/+5
| | | | Improve documentation, bump bounds and cabal-version.
* ghc-cabal: Manually specify -XHaskell2010Ben Gamari2021-12-011-1/+2
| | | | | | | Otherwise we end up with issues like #19631 when bootstrapping using GHC 9.2 and above. Fixes #19631.
* hadrian: Don't pass empty paths via -IBen Gamari2021-12-011-2/+2
| | | | | Previously we could in some cases add empty paths to `cc`'s include file search path. See #20578.
* rts/RtsSymbols: Provide a proper prototype for environBen Gamari2021-12-011-1/+5
| | | | | | | Previously we relied on Sym_NeedsProto, but this gave the symbol a type which conflicts with the definition that may be provided by unistd.h. Fixes #20577.
* Dump non-module specific info to file #20316Carrie Xu2021-12-019-21/+41
| | | | | | | | | - Change the dumpPrefix to FilePath, and default to non-module - Add dot to seperate dump-file-prefix and suffix - Modify user guide to introduce how dump files are named - This commit does not affect Ghci dump file naming. See also #17500
* gitlab-ci: Introduce no_tntc jobBen Gamari2021-12-011-0/+8
| | | | A manual job for testing the non-tables-next-to-code configuration.
* rts: Refactor SRT representation selectionBen Gamari2021-12-014-37/+72
| | | | | | The goal here is to make the SRT selection logic a bit clearer and allow configurations which we currently don't support (e.g. using a full word in the info table even when TNTC is used).
* rts/ProfHeap.c: Use setlocale() on platforms where uselocale() is not availablePHO2021-12-012-6/+17
| | | | Not all platforms have per-thread locales. NetBSD doesn't have uselocale() in particular. Using setlocale() is of course not a safe thing to do, but it would be better than no GHC at all.
* Fix caluclation of nonmoving GC elapsed timeMitchell Rosen2021-11-301-2/+2
| | | | Fixes #20751
* docs/users_guide/bugs.rst: RewordingAnton-Latukha2021-11-291-3/+3
| | | | | | | | It is either "slightly" || "significantly". If it is "bogus" - then no quotes around "optimization" & overall using word "bogus" or use quotes in that way in documentation is... Instead, something like "hack" or "heuristic" can be used there.
* Use Monoid in hptSomeThingsBelowUsSylvain Henry2021-11-291-18/+15
| | | | | | | | | | It seems to have a moderate but good impact on perf tests in CI. In particular: MultiLayerModules(normal) ghc/alloc 3125771138.7 3065532240.0 -1.9% So it's likely that huge projects will benefit from this.
* TTG: replace Void/NoExtCon with DataConCantHappenKrzysztof Gogolewski2021-11-2914-147/+134
| | | | | | | | There were two ways to indicate that a TTG constructor is unused in a phase: `NoExtCon` and `Void`. This unifies the code, and uses the name 'DataConCantHappen', following the discussion at MR 7041. Updates haddock submodule
* linker: Introduce linker_verbose debug outputBen Gamari2021-11-296-115/+132
| | | | | | | | This splits the -Dl RTS debug output into two distinct flags: * `+RTS -Dl` shows errors and debug output which scales with at most O(# objects) * `+RTS -DL` shows debug output which scales with O(# symbols)t
* Make ambient MinGW support a proper settingsJohn Ericson2021-11-2714-40/+55
| | | | | | | Get rid of `USE_INPLACE_MINGW_TOOLCHAIN` and use a settings file entry instead. The CPP setting was originally introduced in f065b6b012.
* Fix top-level configure script so --disable-foo worksJohn Ericson2021-11-271-12/+10
|
* Factor our `FP_CAPITALIZE_YES_NO`John Ericson2021-11-275-17/+18
| | | | | This deduplicates converting from yes/no to YES/NO in the configure scripts while also making it safer.
* Allow keywords which can be used as variables to be used with ↵Matthew Pickering2021-11-263-1/+11
| | | | | | | | | | | | | OverloadedDotSyntax There are quite a few keywords which are allowed to be used as variables. Such as "as", "dependency" etc. These weren't accepted by OverloadedDotSyntax. The fix is pretty simple, use the varid production rather than raw VARID. Fixes #20723
* Reflect type change in the haddock commentKai Prott2021-11-261-1/+1
|
* Adapt plugin test caseKai Prott2021-11-261-1/+1
|