[Git][ghc/ghc][wip/T24040-ghci-timeout-squashed] 112 commits: hadrian: Build all executables in bin/ folder

Hassan Al-Awwadi (@hassan.awwadi) gitlab at gitlab.haskell.org
Mon Feb 5 17:53:21 UTC 2024



Hassan Al-Awwadi pushed to branch wip/T24040-ghci-timeout-squashed at Glasgow Haskell Compiler / GHC


Commits:
bd5bb4b3 by Matthew Pickering at 2024-02-05T18:52:44+01:00
hadrian: Build all executables in bin/ folder

In the end the bindist creation logic copies them all into the bin
folder. There is no benefit to building a specific few binaries in the
lib/bin folder anymore.

This also removes the ad-hoc logic to copy the touchy and unlit
executables from stage0 into stage1. It takes <1s to build so we might
as well just build it.

- - - - -
67838b4b by Zubin Duggal at 2024-02-05T18:52:44+01:00
testsuite: mark jspace as fragile on i386.

This test has been flaky for some time and has been failing consistently on
i386-linux since 8e0446df landed.

See #24261

- - - - -
28284659 by Ben Bellick at 2024-02-05T18:52:44+01:00
Deprecate -ddump-json and introduce -fdiagnostics-as-json

Addresses #19278

This commit deprecates the underspecified -ddump-json flag and
introduces a newer, well-specified flag -fdiagnostics-as-json.

Also included is a JSON schema as part of the documentation.

The -ddump-json flag will be slated for removal shortly after this merge.

- - - - -
65a64404 by Ben Bellick at 2024-02-05T18:52:44+01:00
Deprecate -ddump-json and introduce -fdiagnostics-as-json

Addresses #19278

This commit deprecates the underspecified -ddump-json flag and
introduces a newer, well-specified flag -fdiagnostics-as-json.

Also included is a JSON schema as part of the documentation.

The -ddump-json flag will be slated for removal shortly after this merge.

- - - - -
522aadc7 by Ömer Sinan Ağacan at 2024-02-05T18:52:44+01:00
Fix BNF in user manual 6.6.8.2: formal syntax for instance declarations

- - - - -
d67517b4 by Zubin Duggal at 2024-02-05T18:52:44+01:00
docs: document permissibility of -XOverloadedLabels (#24249)

Document the permissibility introduced by
https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0170-unrestricted-overloadedlabels.rst

- - - - -
9a0202dc by Ömer Sinan Ağacan at 2024-02-05T18:52:44+01:00
Fix a code block syntax in user manual sec. 6.8.8.6

- - - - -
842258df by Ben Gamari at 2024-02-05T18:52:44+01:00
genSym: Reimplement via CAS on 32-bit platforms

Previously the remaining use of the C implementation on 32-bit platforms
resulted in a subtle bug, #24261. This was due to the C object (which
used the RTS's `atomic_inc64` macro) being compiled without `-threaded`
yet later being used in a threaded compiler.

Side-step this issue by using the pure Haskell `genSym` implementation on
all platforms. This required implementing `fetchAddWord64Addr#` in terms
of CAS on 64-bit platforms.

- - - - -
c9f02886 by Xiaoyan Ren at 2024-02-05T18:52:44+01:00
Do not color the diagnostic code in error messages (#24172)

- - - - -
063815ef by Krzysztof Gogolewski at 2024-02-05T18:52:44+01:00
Enforce that bindings of implicit parameters are lifted

Fixes #24298

- - - - -
deef4940 by Matthew Craven at 2024-02-05T18:52:44+01:00
StgToCmm: Detect some no-op case-continuations

...and generate no code for them. Fixes #24264.

- - - - -
f7fb974b by Krzysztof Gogolewski at 2024-02-05T18:52:44+01:00
Revert "testsuite: mark jspace as fragile on i386."

This reverts commit 0038d052c8c80b4b430bb2aa1c66d5280be1aa95.

The atomicity bug should be fixed by !11802.

- - - - -
c0f2995b by Krzysztof Gogolewski at 2024-02-05T18:52:44+01:00
Refactor: store [[PrimRep]] rather than [Type] in STG

StgConApp stored a list of types. This list was used exclusively
during unarisation of unboxed sums (mkUbxSum).
However, this is at a wrong level of abstraction:
STG shouldn't be concerned with Haskell types, only PrimReps.
Update the code to store a [[PrimRep]]. Also, there's no point in storing
this list when we're not dealing with an unboxed sum.

- - - - -
f7730e87 by Ömer Sinan Ağacan at 2024-02-05T18:52:44+01:00
Kind signatures docs: mention that they're allowed in newtypes

- - - - -
d5975582 by Zubin Duggal at 2024-02-05T18:52:44+01:00
ci: Ensure we use the correct bindist name for the test artifact when generating
release ghcup metadata

Fixes #24268

- - - - -
5a30b430 by Krzysztof Gogolewski at 2024-02-05T18:52:44+01:00
Refactor: remove calls to typePrimRepArgs

The function typePrimRepArgs is just a thin wrapper around
typePrimRep, adding a VoidRep if the list is empty.
However, in StgToByteCode, we were discarding that VoidRep anyway,
so there's no point in calling it.

- - - - -
e3c2281a by mmzk1526 at 2024-02-05T18:52:44+01:00
Use "-V" for alex version check for better backward compatibility
Fixes #24302.
In recent versions of alex, "-v" is used for "--verbose" instead of "-version".

- - - - -
9242363f by Krzysztof Gogolewski at 2024-02-05T18:52:44+01:00
Fix VoidRep handling in ghci debugger

'go' inside extractSubTerms was giving a bad result given a VoidRep,
attempting to round towards the next multiple of 0.
I don't understand much about the debugger but the code should be better
than it was.

Fixes #24306

- - - - -
01e17829 by Krzysztof Gogolewski at 2024-02-05T18:52:44+01:00
VoidRep-related refactor

* In GHC.StgToByteCode, replace bcIdPrimId with idPrimRep,
  bcIdArgRep with idArgRep, atomPrimRep with stgArgRep1.
  All of them were duplicates.
* In GHC.Stg.Unarise, we were converting a PrimRep to a Type and back to
  PrimRep. Remove the calls to primRepToType and typePrimRep1 which cancel out.
* In GHC.STG.Lint, GHC.StgToCmm, GHC.Types.RepType we were filtering out
  VoidRep from the result of typePrimRep. But typePrimRep never returns
  VoidRep - remove the filtering.

- - - - -
7a5451c4 by brian at 2024-02-05T18:52:45+01:00
Add unaligned Addr# primops

Implements CLC proposal #154:
  https://github.com/haskell/core-libraries-committee/issues/154

* add unaligned addr primops

* add tests

* accept tests

* add documentation

* fix js primops

* uncomment in access ops

* use Word64 in tests

* apply suggestions

* remove extra file

* move docs

* remove random options

* use setByteArray# primop

* better naming

* update base-exports test

* add base-exports for other architectures

- - - - -
5c1e58c8 by Krzysztof Gogolewski at 2024-02-05T18:52:45+01:00
Remove VoidRep from PrimRep, introduce PrimOrVoidRep

This introduces

data PrimOrVoidRep = VoidRep | NVRep PrimRep

changes typePrimRep1 to return PrimOrVoidRep, and adds a new function
typePrimRepU to be used when the argument is definitely non-void.
Details in Note [VoidRep] in GHC.Types.RepType.

Fixes #19520

- - - - -
fd0b4024 by Matthew Craven at 2024-02-05T18:52:45+01:00
Apply Note [Sensitivity to unique increment] to LargeRecord

- - - - -
1ab5778b by Sebastian Graf at 2024-02-05T18:52:45+01:00
Debugging: Add diffUFM for convenient diffing between UniqFMs

- - - - -
435ac85b by Sebastian Graf at 2024-02-05T18:52:45+01:00
Rename Opt_D_dump_stranal to Opt_D_dump_dmdanal

... and Opt_D_dump_str_signatures to Opt_D_dump_dmd_signatures

- - - - -
b10aea98 by Sebastian Graf at 2024-02-05T18:52:45+01:00
Deprecate -ddump-stranal and -ddump-str-signatures

... and suggest -ddump-dmdanal and -ddump-dmd-signatures instead

- - - - -
26b1f5c4 by Sebastian Graf at 2024-02-05T18:52:45+01:00
Move testsuite/tests/stranal to testsuite/tests/dmdanal

A separate commit so that the rename is obvious to Git(Lab)

- - - - -
76b0e6c1 by Sebastian Graf at 2024-02-05T18:52:45+01:00
CoreSubst: Stricten `substBndr` and `cloneBndr`

Doing so reduced allocations of `cloneBndr` by about 25%.

```
T9233(normal) ghc/alloc    672,488,656    663,083,216  -1.4% GOOD
T9675(optasm) ghc/alloc    423,029,256    415,812,200  -1.7%

    geo. mean                                          -0.1%
    minimum                                            -1.7%
    maximum                                            +0.1%
```

Metric Decrease:
    T9233

- - - - -
c6833690 by Krzysztof Gogolewski at 2024-02-05T18:52:45+01:00
Deprecate -Wsemigroup

This warning was used to prepare for Semigroup becoming a superclass
of Monoid, and for (<>) being exported from Prelude. This happened in
GHC 8.4 in 8ae263ceb3566 and feac0a3bc69fd3.

The leftover logic for (<>) has been removed in GHC 9.8, 4d29ecdfcc79.
Now the warning does nothing at all and can be deprecated.

- - - - -
b2341e48 by amesgen at 2024-02-05T18:52:45+01:00
WASM metadata: use correct GHC version

- - - - -
9403b956 by Xiaoyan Ren at 2024-02-05T18:52:45+01:00
Allow SCC declarations in TH (#24081)

- - - - -
90d94b9d by Xiaoyan Ren at 2024-02-05T18:52:45+01:00
Fix prettyprinting of SCC pragmas

- - - - -
8839be2b by Matthew Craven at 2024-02-05T18:52:45+01:00
Fix loopification in the presence of void arguments

This also removes Note [Void arguments in self-recursive tail calls],
which was just misleading.  It's important to count void args both
in the function's arity and at the call site.

Fixes #24295.

- - - - -
8fed35d6 by Zubin Duggal at 2024-02-05T18:52:45+01:00
testsuite: Teach testsuite driver about c++ sources

- - - - -
cb491133 by Zubin Duggal at 2024-02-05T18:52:45+01:00
driver: Set -DPROFILING when compiling C++ sources with profiling

Earlier, we used to pass all preprocessor flags to the c++ compiler.
This meant that -DPROFILING was passed to the c++ compiler because
it was a part of C++ flags
However, this was incorrect and the behaviour was changed in
8ff3134ed4aa323b0199ad683f72165e51a59ab6. See #21291.

But that commit exposed this bug where -DPROFILING was no longer being passed
when compiling c++ sources.

The fix is to explicitly include -DPROFILING in `opt_cxx` when profiling is
enabled to ensure we pass the correct options for the way to both C and C++
compilers

Fixes #24286

- - - - -
d1334aa2 by Zubin Duggal at 2024-02-05T18:52:45+01:00
testsuite: rename objcpp -> objcxx

To avoid confusion with C Pre Processsor

- - - - -
f28c4558 by Simon Peyton Jones at 2024-02-05T18:52:45+01:00
Make TYPE and CONSTRAINT not-apart

Issue #24279 showed up a bug in the logic in GHC.Core.Unify.unify_ty
which is supposed to make TYPE and CONSTRAINT be not-apart.

Easily fixed.

- - - - -
99f79c5c by Zubin Duggal at 2024-02-05T18:52:45+01:00
ci: Fix typo in mk_ghcup_metadata.py

There was a missing colon in the fix to #24268 in 989bf8e53c08eb22de716901b914b3607bc8dd08

- - - - -
2a4cc7a7 by Zubin Duggal at 2024-02-05T18:52:45+01:00
release-ci: remove release-x86_64-linux-deb11-release+boot_nonmoving_gc job

There is no reason to have this release build or distribute this variation.
This configuration is for testing purposes only.

- - - - -
b3c11bd2 by Sebastian Graf at 2024-02-05T18:52:45+01:00
Parser: Add a Note detailing why we need happy's `error` to implement layout

- - - - -
ebc6225b by Krzysztof Gogolewski at 2024-02-05T18:52:46+01:00
Turn -Wtype-equality-out-of-scope on by default

Also remove -Wnoncanonical-{monoid,monad}-instances from -Wcompat,
since they are enabled by default. Refresh wcompat-warnings/ test
with new -Wcompat warnings.

Part of #24267

Co-authored-by: sheaf <sam.derbyshire at gmail.com>

- - - - -
973108c8 by Sebastian Graf at 2024-02-05T18:52:46+01:00
Arity: Require called *exactly once* for eta exp with -fpedantic-bottoms (#24296)

In #24296, we had a program in which we eta expanded away an error despite the
presence of `-fpedantic-bottoms`.
This was caused by turning called *at least once* lambdas into one-shot lambdas,
while with `-fpedantic-bottoms` it is only sound to eta expand over lambdas that
are called *exactly* once.
An example can be found in `Note [Combining arity type with demand info]`.

Fixes #24296.

- - - - -
5084b27d by Andreas Klebinger at 2024-02-05T18:52:46+01:00
Aarch64: Enable -mfma by default.

Fixes #24311

- - - - -
36e1db81 by Jason Shipman at 2024-02-05T18:52:46+01:00
Add more instances for Compose: Fractional, RealFrac, Floating, RealFloat

CLC proposal #226 https://github.com/haskell/core-libraries-committee/issues/226

- - - - -
805ee846 by Sebastian Graf at 2024-02-05T18:52:46+01:00
Pmc: COMPLETE pragmas associated with Family TyCons should apply to representation TyCons as well (#24326)

Fixes #24326.

- - - - -
5ff8466f by sheaf at 2024-02-05T18:52:46+01:00
Use lookupOccRn_maybe in TH.lookupName

When looking up a value, we want to be able to find both variables
and record fields. So we should not use the lookupSameOccRn_maybe
function, as we can't know ahead of time which record field namespace
a record field with the given textual name will belong to.

Fixes #24293

- - - - -
ee8a0a12 by Krzysztof Gogolewski at 2024-02-05T18:52:46+01:00
Make the build more strict on documentation errors

* Detect undefined labels. This can be tested by adding :ref:`nonexistent`
  to a documentation rst file; attempting to build docs will fail.
  Fixed the undefined label in `9.8.1-notes.rst`.
* Detect errors. While we have plenty of warnings, we can at least enforce
  that Sphinx does not report errors.
  Fixed the error in `required_type_arguments.rst`.

Unrelated change: I have documented that the `-dlint` enables
`-fcatch-nonexhaustive-cases`, as can be verified by checking
`enableDLint`.

- - - - -
28b4f4cb by Javier Sagredo at 2024-02-05T18:52:46+01:00
Profiling: Adds an option to not start time profiling at startup

Using the functionality provided by
d89deeba47ce04a5198a71fa4cbc203fe2c90794, this patch creates a new rts
flag `--no-automatic-time-samples` which disables the time profiling
when starting a program. It is then expected that the user starts it
whenever it is needed.

Fixes #24337

- - - - -
541d5514 by Matthew Pickering at 2024-02-05T18:52:46+01:00
eventlog: Fix off-by-one error in postIPE

We were missing the extra_comma from the calculation of the size of the
payload of postIPE. This was causing assertion failures when the event
would overflow the buffer by one byte, as ensureRoomForVariable event
would report there was enough space for `n` bytes but then we would
write `n + 1` bytes into the buffer.

Fixes #24287

- - - - -
c599de08 by Simon Peyton Jones at 2024-02-05T18:52:46+01:00
Improve SpecConstr (esp nofib/spectral/ansi)

This MR makes three improvements to SpecConstr: see #24282

* It fixes an outright (and recently-introduced) bug in `betterPat`, which
  was wrongly forgetting to compare the lengths of the argument lists.

* It enhances ConVal to inclue a boolean for work-free-ness, so that the
  envt can contain non-work-free constructor applications, so that we
  can do more: see Note [ConVal work-free-ness]

* It rejigs `subsumePats` so that it doesn't reverse the list.  This can
  make a difference because, when patterns overlap, we arbitrarily pick
  the first.  There is no "right" way, but this retains the old
  pre-subsumePats behaviour, thereby "fixing" the regression in #24282.

Nofib results

   +========================================
   |                 spectral/ansi  -21.14%
   | spectral/hartel/comp_lab_zift   -0.12%
   |       spectral/hartel/parstof   +0.09%
   |           spectral/last-piece   -2.32%
   |           spectral/multiplier   +6.03%
   |                 spectral/para   +0.60%
   |               spectral/simple   -0.26%
   +========================================
   |                     geom mean   -0.18%
   +----------------------------------------

The regression in `multiplier` is sad, but it simply replicates GHC's
previous behaviour (e.g. GHC 9.6).

- - - - -
febd8628 by Matthew Pickering at 2024-02-05T18:52:46+01:00
hadrian: Reduce Cabal verbosity

The comment claims that `simpleUserHooks` decrease verbosity, and it
does, but only for the `postConf` phase. The other phases are too
verbose with `-V`.

At the moment > 5000 lines of the build log are devoted to output from
`cabal copy`.

So I take the simple approach and just decrease the verbosity level
again.

If the output of `postConf` is essential then it would be better to
implement our own `UserHooks` which doesn't decrease the verbosity for
`postConf`.

Fixes #24338

- - - - -
92d60e0f by Matthew Pickering at 2024-02-05T18:52:46+01:00
Stop retaining old ModGuts throughout subsequent simplifier phases

Each phase of the simplifier typically rewrites the majority of ModGuts,
so we want to be able to release the old ModGuts as soon as possible.

`name_ppr_ctxt` lives throught the whole optimiser phase and it was
retaining a reference to `ModGuts`, so we were failing to release the
old `ModGuts` until the end of the phase (potentially doubling peak
memory usage for that particular phase).

This was discovered using eras profiling (#24332)

Fixes #24328

- - - - -
c5ab7a32 by Matthew Pickering at 2024-02-05T18:52:46+01:00
Update nofib submodule

- - - - -
44133928 by Cheng Shao at 2024-02-05T18:52:46+01:00
ci: bump ci-images for updated wasm image

- - - - -
00060401 by Cheng Shao at 2024-02-05T18:52:46+01:00
base: treat all FDs as "nonblocking" on wasm

On posix platforms, when performing read/write on FDs, we check the
nonblocking flag first. For FDs without this flag (e.g. stdout), we
call fdReady() first, which in turn calls poll() to wait for I/O to be
available on that FD. This is problematic for wasm32-wasi: although
select()/poll() is supported via the poll_oneoff() wasi syscall, that
syscall is rather heavyweight and runtime behavior differs in
different wasi implementations. The issue is even worse when targeting
browsers, given there's no satisfactory way to implement async I/O as
a synchronous syscall, so existing JS polyfills for wasi often give up
and simply return ENOSYS.

Before we have a proper I/O manager that avoids poll_oneoff() for
async I/O on wasm, this patch improves the status quo a lot by merely
pretending all FDs are "nonblocking". Read/write on FDs will directly
invoke read()/write(), which are much more reliably handled in
existing wasi implementations, especially those in browsers.

Fixes #23275 and the following test cases: T7773 isEOF001 openFile009
T4808 cgrun025

Approved by CLC proposal #234:
https://github.com/haskell/core-libraries-committee/issues/234

- - - - -
38febab2 by Andrew Lelechenko at 2024-02-05T18:52:46+01:00
base: clarify how to disable warnings about partiality of Data.List.{head,tail}

- - - - -
6f207d82 by Simon Peyton Jones at 2024-02-05T18:52:46+01:00
Fix four bug in handling of (forall cv. body_ty)

These bugs are all described in #24335

It's not easy to provoke the bug, hence no test case.

- - - - -
d0901527 by Alexis King at 2024-02-05T18:52:47+01:00
Always refresh profiling CCSes after running pending initializers

Fixes #24171.

- - - - -
65a1c43c by Oleg Grenrus at 2024-02-05T18:52:47+01:00
Set default-language: GHC2021 in ghc library

Go through compiler/ sources, and remove
all BangPatterns (and other GHC2021 enabled extensions in these files).

- - - - -
a8d2fe93 by Matthew Pickering at 2024-02-05T18:52:47+01:00
testsuite: Remove unused have_library function

Also remove the hence unused testsuite option `--test-package-db`.

Fixes #24342

- - - - -
8c0c507b by Jade at 2024-02-05T18:52:47+01:00
Fix Spelling in the compiler

Tracking: #16591

- - - - -
61d8b353 by Matthew Pickering at 2024-02-05T18:52:47+01:00
testsuite: Implement `isInTreeCompiler` in a more robust way

Just a small refactoring to avoid redundantly specifying the same
strings in two different places.

- - - - -
b33e9223 by Jade at 2024-02-05T18:52:47+01:00
Change maintainer email from cvs-ghc at haskell.org to ghc-devs at haskell.org. Fixes #22142

- - - - -
384c3720 by Jade at 2024-02-05T18:52:47+01:00
Enhance Documentation of functions exported by Data.Function

This patch aims to improve the documentation of functions exported
in Data.Function

Tracking: #17929
Fixes: #10065

- - - - -
764c6315 by Jade at 2024-02-05T18:52:47+01:00
Improve documentation of hGetLine.

- Add explanation for whether a newline is returned
- Add examples

Fixes #14804

- - - - -
75ea4bda by Cheng Shao at 2024-02-05T18:52:47+01:00
Fix genapply for cross-compilation by nuking fragile CPP logic

This commit fixes incorrectly built genapply when cross compiling
(#24347) by nuking all fragile CPP logic in it from the orbit. All
target-specific info are now read from DerivedConstants.h at runtime,
see added note for details. Also removes a legacy Makefile and adds
haskell language server support for genapply.

- - - - -
ef2f8577 by Cheng Shao at 2024-02-05T18:52:47+01:00
rts: enable wasm32 register mapping

The wasm backend didn't properly make use of all Cmm global registers
due to #24347. Now that it is fixed, this patch re-enables full
register mapping for wasm32, and we can now generate smaller & faster
wasm modules that doesn't always spill arguments onto the stack. Fixes #22460 #24152.

- - - - -
57a8c856 by Greg Steuck at 2024-02-05T18:52:48+01:00
Avoid utf8 in primops.txt.pp comments

They don't make it through readFile' without explicitly setting the
encoding. See https://gitlab.haskell.org/ghc/ghc/-/issues/17755

- - - - -
d7e5fcdc by David Binder at 2024-02-05T18:52:48+01:00
Bump hpc and hpc-bin submodule

Bump hpc to 0.7.0.1
Bump hpc-bin to commit d1780eb2

- - - - -
5e33dd40 by Ben Gamari at 2024-02-05T18:52:48+01:00
testsuite: Ignore stderr in T8089

Otherwise spurious "Killed: 9" messages to stderr may cause the test to fail.
Fixes #24361.
- - - - -
46b61c77 by sheaf at 2024-02-05T18:52:48+01:00
Fix FMA instruction on LLVM

We were emitting the wrong instructions for fused multiply-add
operations on LLVM:

  - the instruction name is "llvm.fma.f32" or "llvm.fma.f64", not "fmadd"
  - LLVM does not support other instructions such as "fmsub"; instead
    we implement these by flipping signs of some arguments
  - the instruction is an LLVM intrinsic, which requires handling it
    like a normal function call instead of a machine instruction

Fixes #24223

- - - - -
8771e614 by Andrei Borzenkov at 2024-02-05T18:52:48+01:00
Add changelog entry for renaming tuples from (,,...,,) to Tuple<n> (24291)

- - - - -
82542391 by Cheng Shao at 2024-02-05T18:52:48+01:00
compiler: remove unused GHC.Linker module

The GHC.Linker module is empty and unused, other than as a hack for
the make build system. We can remove it now that make is long gone;
the note is moved to GHC.Linker.Loader instead.

- - - - -
c09f5227 by Hécate Moonlight at 2024-02-05T18:52:48+01:00
Clarification for newtype constructors when using `coerce`

- - - - -
80428daf by Matt Walker at 2024-02-05T18:52:48+01:00
Fix #24308

Add tests for semicolon separated where clauses

- - - - -
a6a68ec8 by Ben Gamari at 2024-02-05T18:52:48+01:00
hsc2hs: Bump submodule

- - - - -
391e5b5d by Ben Gamari at 2024-02-05T18:52:48+01:00
Bump containers submodule to 0.7

- - - - -
a15a7dd8 by Sebastian Nagel at 2024-02-05T18:52:48+01:00
base: with{Binary}File{Blocking} only annotates own exceptions

Fixes #20886

This ensures that inner, unrelated exceptions are not misleadingly
annotated with the opened file.

- - - - -
5a832eef by Andreas Klebinger at 2024-02-05T18:52:48+01:00
Fix fma warning when using llvm on aarch64.

On aarch64 fma is always on so the +fma flag doesn't exist for that
target. Hence no need to try and pass +fma to llvm.

Fixes #24379

- - - - -
c7d278be by sheaf at 2024-02-05T18:52:48+01:00
No shadowing warnings for NoFieldSelector fields

This commit ensures we don't emit shadowing warnings when a user
shadows a field defined with NoFieldSelectors.

Fixes #24381

- - - - -
bf9dadc9 by Patrick at 2024-02-05T18:52:48+01:00
Fix bug wrong span of nested_doc_comment #24378

close #24378
1. Update the start position of span in `nested_doc_comment` correctly.
and hence the spans of identifiers of haddoc can be computed correctly.
2. add test `HaddockSpanIssueT24378`.

- - - - -
3186c456 by Alexey Radkov at 2024-02-05T18:52:48+01:00
Fix irrelevant dodgy-foreign-imports warning on import f-pointers by value

A test *сс018* is attached (not sure about the naming convention though).
Note that without the fix, the test fails with the *dodgy-foreign-imports*
warning passed to stderr. The warning disappears after the fix.

GHC shouldn't warn on imports of natural function pointers from C by value
(which is feasible with CApiFFI), such as

```haskell
foreign import capi "cc018.h value f" f :: FunPtr (Int -> IO ())
```

where

```c
void (*f)(int);
```

See a related real-world use-case
[here](https://gitlab.com/daniel-casanueva/pcre-light/-/merge_requests/17).
There, GHC warns on import of C function pointer `pcre_free`.

- - - - -
6f7bdeb1 by Alexey Radkov at 2024-02-05T18:52:48+01:00
Rename test cc018 -> T24034

- - - - -
f8956cbf by Ben Gamari at 2024-02-05T18:52:48+01:00
rts/TraverseHeap.c: Ensure that PosixSource.h is included first
- - - - -
06c1e028 by Simon Peyton Jones at 2024-02-05T18:52:48+01:00
Make decomposeRuleLhs a bit more clever

This fixes #24370 by making decomposeRuleLhs undertand
dictionary /functions/ as well as plain /dictionaries/

- - - - -
52a145e2 by Teo Camarasu at 2024-02-05T18:52:48+01:00
doc: Add -Dn flag to user guide

Resolves #24394
- - - - -
1b96e62d by Ben Gamari at 2024-02-05T18:52:48+01:00
cmm: Introduce MO_RelaxedRead

In hand-written Cmm it can sometimes be necessary to atomically load
from memory deep within an expression (e.g. see the `CHECK_GC` macro).
This MachOp provides a convenient way to do so without breaking the
expression into multiple statements.

- - - - -
45521537 by Ben Gamari at 2024-02-05T18:52:48+01:00
codeGen: Use relaxed accesses in ticky bumping

- - - - -
6c46c2b6 by Ben Gamari at 2024-02-05T18:52:48+01:00
base: use atomic write when updating timer manager

- - - - -
ad6d793c by Ben Gamari at 2024-02-05T18:52:48+01:00
Use relaxed atomics to manipulate TSO status fields

- - - - -
35667742 by Ben Gamari at 2024-02-05T18:52:48+01:00
rts: Add necessary barriers when manipulating TSO owner

- - - - -
1a3487e9 by Ben Gamari at 2024-02-05T18:52:49+01:00
rts: Use `switch` to branch on why_blocked

This is a semantics-preserving refactoring.

- - - - -
b9472d19 by Ben Gamari at 2024-02-05T18:52:49+01:00
rts: Fix synchronization on thread blocking state

We now use a release barrier whenever we update a thread's blocking
state. This required widening StgTSO.why_blocked as AArch64 does not
support atomic writes on 16-bit values.

- - - - -
190b366b by Ben Gamari at 2024-02-05T18:52:49+01:00
rts: Fix data race in threadPaused

This only affects an assertion in the debug RTS and only needs relaxed
ordering.

- - - - -
6ecdca0b by Ben Gamari at 2024-02-05T18:52:49+01:00
rts: Fix data race in threadStatus#

- - - - -
2fcb5c38 by Ben Gamari at 2024-02-05T18:52:49+01:00
rts: Fix data race in Interpreter's preemption check

- - - - -
551bebe7 by Ben Gamari at 2024-02-05T18:52:49+01:00
rts/Messages: Fix data race

- - - - -
53f5f7ad by Ben Gamari at 2024-02-05T18:52:49+01:00
rts/Prof: Fix data race

- - - - -
69b5a6b9 by Ben Gamari at 2024-02-05T18:52:49+01:00
rts: Use relaxed ordering on dirty/clean info tables updates

When changing the dirty/clean state of a mutable object we needn't have
any particular ordering.

- - - - -
5d507b5b by Ben Gamari at 2024-02-05T18:52:49+01:00
codeGen: Use relaxed-read in closureInfoPtr

- - - - -
8f485404 by Ben Gamari at 2024-02-05T18:52:49+01:00
STM: Use acquire loads when possible

Full sequential consistency is not needed here.

- - - - -
636adf26 by Ben Gamari at 2024-02-05T18:52:49+01:00
rts: Use fence rather than redundant load

Previously we would use an atomic load to ensure acquire ordering.
However, we now have `ACQUIRE_FENCE_ON`, which allows us to express this
more directly.

- - - - -
653e1941 by Ben Gamari at 2024-02-05T18:52:49+01:00
rts: Fix data races in profiling timer

- - - - -
9c44ee14 by Ben Gamari at 2024-02-05T18:52:49+01:00
Add Note [C11 memory model]

- - - - -
85d3eaf3 by Cheng Shao at 2024-02-05T18:52:49+01:00
compiler: move generic cmm optimization logic in NCG to a standalone module

This commit moves GHC.CmmToAsm.cmmToCmm to a standalone module,
GHC.Cmm.GenericOpt. The main motivation is enabling this logic to be
run in the wasm backend NCG code, which is defined in other modules
that's imported by GHC.CmmToAsm, causing a cyclic dependency issue.

- - - - -
e74124c0 by Cheng Shao at 2024-02-05T18:52:49+01:00
compiler: explicitly disable PIC in wasm32 NCG

This commit explicitly disables the ncgPIC flag for the wasm32 target.
The wasm backend doesn't support PIC for the time being.

- - - - -
67da7bbe by Cheng Shao at 2024-02-05T18:52:49+01:00
compiler: enable generic cmm optimizations in wasm backend NCG

This commit enables the generic cmm optimizations in other NCGs to be
run in the wasm backend as well, followed by a late cmm control-flow
optimization pass. The added optimizations do catch some corner cases
not handled by the pre-NCG cmm pipeline and are useful in generating
smaller CFGs.

- - - - -
10ce00de by Andrei Borzenkov at 2024-02-05T18:52:49+01:00
Namespacing for WARNING/DEPRECATED pragmas (#24396)

New syntax for WARNING and DEPRECATED pragmas was added,
namely namespace specifierss:

  namespace_spec ::= 'type' | 'data' | {- empty -}

  warning ::= warning_category namespace_spec namelist strings

  deprecation ::= namespace_spec namelist strings

A new data type was introduced to represent these namespace specifiers:

  data NamespaceSpecifier =
    NoSpecifier |
    TypeNamespaceSpecifier (EpToken "type") |
    DataNamespaceSpecifier (EpToken "data")

Extension field XWarning now contains this NamespaceSpecifier.

lookupBindGroupOcc function was changed: it now takes NamespaceSpecifier
and checks that the namespace of the found names matches the passed flag.
With this change {-# WARNING data D "..." #-} pragma will only affect value
namespace and {-# WARNING type D "..." #-} will only affect type
namespace. The same logic is applicable to DEPRECATED pragmas.

Finding duplicated warnings inside rnSrcWarnDecls now takes into
consideration NamespaceSpecifier flag to allow warnings with the
same names that refer to different namespaces.

- - - - -
cd4c251e by Bryan Richter at 2024-02-05T18:52:49+01:00
CI: Disable the test-cabal-reinstall job

Fixes #24363

- - - - -
a16e8506 by Matthew Craven at 2024-02-05T18:52:49+01:00
Bump bytestring submodule to something closer to 0.12.1

...mostly so that 16d6b7e835ffdcf9b894e79f933dd52348dedd0c
(which reworks unaligned writes in Builder) and the stuff in
https://github.com/haskell/bytestring/pull/631 can see wider testing.

The less-terrible code for unaligned writes used in Builder on
hosts not known to be ulaigned-friendly also takes less effort
for GHC to compile, resulting in a metric decrease for T21839c
on some platforms.

The metric increase on T21839r is caused by the unrelated commit
750dac33465e7b59100698a330b44de7049a345c.  It perhaps warrants
further analysis and discussion (see #23822) but is not critical.

Metric Decrease:
T21839c
Metric Increase:
T21839r

- - - - -
c10f31c0 by Rodrigo Mesquita at 2024-02-05T18:52:49+01:00
Work around autotools setting C11 standard in CC/CXX

In autoconf >=2.70, C11 is set by default for $CC and $CXX via the
-std=...11 flag. In this patch, we split the "-std" flag out of the $CC
and $CXX variables, which we traditionally assume to be just the
executable name/path, and move it to $CFLAGS/$CXXFLAGS instead.

Fixes #24324

- - - - -
ed7b33df by Apoorv Ingle at 2024-02-05T18:52:49+01:00
Expand `do` blocks right before typechecking using the `HsExpansion` philosophy.

- Fixes #18324 #20020 #23147 #22788 #15598 #22086 #21206

- The change is detailed in
  - Note [Expanding HsDo with HsExpansion] in `GHC.Tc.Gen.Do`
  - Note [Doing HsExpansion in the Renamer vs Typechecker] in `GHC.Rename.Expr`
         expains the rational of doing expansions in type checker as opposed to in the renamer

- Adds new datatypes:
  - `GHC.Hs.Expr.XXExprGhcRn`: new datatype makes this expansion work easier
    1. Expansion bits for Expressions, Statements and Patterns in (`ExpandedThingRn`)
    2. `PopErrCtxt` a special GhcRn Phase only artifcat to pop the previous error message in the error context stack

  - `GHC.Basic.Origin` now tracks the reason for expansion in case of Generated
    This is useful for type checking cf. `GHC.Tc.Gen.Expr.tcExpr` case for `HsLam`

  - Kills `HsExpansion` and `HsExpanded` as we have inlined them in `XXExprGhcRn` and `XXExprGhcTc`

- Ensures warnings such as
  1. Pattern match checks
  2. Failable patterns
  3. non-() return in body statements are preserved

- Kill `HsMatchCtxt` in favor of `TcMatchAltChecker`

- Testcases:
  * T18324 T20020 T23147 T22788 T15598 T22086
  * T23147b (error message check),
  * DoubleMatch (match inside a match for pmc check)
  * pattern-fails (check pattern match with non-refutable pattern, eg. newtype)
  * Simple-rec (rec statements inside do statment)
  * T22788 (code snippet from #22788)
  * DoExpanion1 (Error messages for body statments)
  * DoExpansion2 (Error messages for bind statements)
  * DoExpansion3 (Error messages for let statements)

Also repoint haddock to the right submodule so that the test (haddockHypsrcTest) pass

Metric Increase 'compile_time/bytes allocated':
    T9020

The testcase is a pathalogical example of a `do`-block with many statements that do nothing.
Given that we are expanding the statements into function binds, we will have to bear
a (small) 2% cost upfront in the compiler to unroll the statements.

- - - - -
2e7ac20a by Vladislav Zavialov at 2024-02-05T18:52:49+01:00
Reduce parser allocations in allocateCommentsP

In the most common case, the comment queue is empty, so we can skip the
work of processing it. This reduces allocations by about 10% in the
parsing001 test.

Metric Decrease:
    MultiLayerModulesRecomp
    parsing001

- - - - -


30 changed files:

- .gitlab-ci.yml
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/InfoTable.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/CommonBlockElim.hs
- compiler/GHC/Cmm/ContFlowOpt.hs
- compiler/GHC/Cmm/Dataflow.hs
- compiler/GHC/Cmm/Dataflow/Graph.hs
- compiler/GHC/Cmm/Expr.hs
- + compiler/GHC/Cmm/GenericOpt.hs
- compiler/GHC/Cmm/Graph.hs
- compiler/GHC/Cmm/Info.hs
- compiler/GHC/Cmm/Info/Build.hs
- compiler/GHC/Cmm/LayoutStack.hs
- compiler/GHC/Cmm/Liveness.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Node.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Pipeline.hs
- compiler/GHC/Cmm/ProcPoint.hs
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/Cmm/Utils.hs
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cb16c8d0ca90b7ecce4e0a36761c247d2eea1b67...2e7ac20adfe9da9b99375001f1268feab8c0f73b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/cb16c8d0ca90b7ecce4e0a36761c247d2eea1b67...2e7ac20adfe9da9b99375001f1268feab8c0f73b
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240205/2240f204/attachment-0001.html>


More information about the ghc-commits mailing list