[Git][ghc/ghc][ghc-9.6] 41 commits: rts: Various warnings fixes

Zubin (@wz1000) gitlab at gitlab.haskell.org
Mon Apr 15 12:18:24 UTC 2024



Zubin pushed to branch ghc-9.6 at Glasgow Haskell Compiler / GHC


Commits:
27bfad83 by Ben Gamari at 2024-03-26T14:09:03+05:30
rts: Various warnings fixes

(cherry picked from commit 1e48c43483693398001bfb0ae644a3558bf6a9f3)

- - - - -
04ca575c by Cheng Shao at 2024-04-02T15:06:39+05:30
compiler: fix eager blackhole symbol in wasm32 NCG

(cherry picked from commit fe50eb3510ca730c4d2fc57778d380fdc493abd8)

- - - - -
b89427db by Cheng Shao at 2024-04-02T15:07:17+05:30
testsuite: fix optasm tests for wasm32

(cherry picked from commit af77114815ad9052261898c830171e49fbed5160)

- - - - -
8bfaa7a4 by Matthew Pickering at 2024-04-02T15:08:07+05:30
testsuite: Add wasm32 to testsuite arches with NCG

The compiler --info reports that wasm32 compilers have a NCG, so we
should agree with that here.

(cherry picked from commit 1b90735c99f1179328f6dd67dbcc81f964901a19)

- - - - -
69b6dcb7 by PHO at 2024-04-02T15:09:07+05:30
Don't assume the current locale is *.UTF-8, set the encoding explicitly

primops.txt contains Unicode characters:
> LC_ALL=C ./genprimopcode --data-decl < ./primops.txt
> genprimopcode: <stdin>: hGetContents: invalid argument (cannot decode byte sequence starting from 226)

Hadrian must also avoid using readFile' to read primops.txt because it
tries to decode the file with a locale-specific encoding.

(cherry picked from commit 52c0fc691e6501e99a96693ec1fc02e3c93a4fbc)

- - - - -
2fb2272b by mmzk1526 at 2024-04-02T15:09:26+05:30
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".

(cherry picked from commit c7be0c680d96ba6209c86e509ab2682e5041a53d)

- - - - -
db500aef by Matthew Craven at 2024-04-02T15:11:32+05:30
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.

(cherry picked from commit ae9cc1a84c9f470b77d98423400e6dfa95b2449b)

- - - - -
7a0b40b5 by Simon Peyton Jones at 2024-04-02T15:12:18+05:30
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.

(cherry picked from commit af6932d6c068361c6ae300d52e72fbe13f8e1f18)

- - - - -
16243c32 by Matthew Pickering at 2024-04-02T15:12:33+05:30
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

(cherry picked from commit 5776008c7a5581193c3e72e59451ad49abac9d81)

- - - - -
dea31f2c by Jade at 2024-04-02T15:14:31+05:30
Improve documentation of hGetLine.

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

Fixes #14804

(cherry picked from commit ab47a43d64f6b7d4fc181645171c31ba2db1eebe)

- - - - -
0632a1f1 by Hécate Moonlight at 2024-04-02T15:15:10+05:30
Clarification for newtype constructors when using `coerce`

(cherry picked from commit 699da01bbbf3e42c7d38b9cfe443dd0e8e256342)

- - - - -
111d1613 by Patrick at 2024-04-02T15:16:13+05:30
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`.

(cherry picked from commit 8eeadfad3a0035f8c5b339782676ff23572e0e5e)

- - - - -
9f893fe9 by Teo Camarasu at 2024-04-02T15:16:46+05:30
doc: Add -Dn flag to user guide

Resolves #24394

(cherry picked from commit 94ce031ddc84ee702c12a11793028ef21e65fa00)

- - - - -
7a9555f5 by Rodrigo Mesquita at 2024-04-02T15:17:03+05:30
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

(cherry picked from commit cdddeb0f1280b40cc194028bbaef36e127175c4c)

- - - - -
1ad632d2 by Zubin Duggal at 2024-04-02T15:17:15+05:30
driver: Really don't lose track of nodes when we fail to resolve cycles

This fixes a bug in 8db8d2fd1c881032b1b360c032b6d9d072c11723, where we could lose
track of acyclic components at the start of an unresolved cycle. We now ensure we
never loose track of any of these components.

As T24275 demonstrates, a "cyclic" SCC might not really be a true SCC:

When viewed without boot files, we have a single SCC

```
[REC main:T24275B [main:T24275B {-# SOURCE #-},
                   main:T24275A {-# SOURCE #-}]
     main:T24275A [main:T24275A {-# SOURCE #-}]]
```

But with boot files this turns into

```
[NONREC main:T24275B {-# SOURCE #-} [],
 REC main:T24275B [main:T24275B {-# SOURCE #-},
                   main:T24275A {-# SOURCE #-}]
    main:T24275A {-# SOURCE #-} [main:T24275B],
 NONREC main:T24275A [main:T24275A {-# SOURCE #-}]]
```

Note that this is truly not an SCC, as no nodes are reachable from T24275B.hs-boot.
However, we treat this entire group as a single "SCC" because it seems so when we
analyse the graph without taking boot files into account.

Indeed, we must return a single ResolvedCycle element in the BuildPlan for this
as described in Note [Upsweep].

However, since after resolving this is not a true SCC anymore, `findCycle` fails
to find a cycle and we have a sub-optimal error message as a result.

To handle this, I extended `findCycle` to not assume its input is an SCC, and to
try harder to find cycles in its input.

Fixes #24275

(cherry picked from commit 532993c8160d960f848e7abd401774b6879e3ee8)

- - - - -
c821fd7c by Matthew Pickering at 2024-04-02T15:17:30+05:30
distrib/configure: Fix typo in CONF_GCC_LINKER_OPTS_STAGE2 variable

Instead we were setting CONF_GCC_LINK_OPTS_STAGE2 which meant that we
were missing passing `--target` when invoking the linker.

Fixes #24414

(cherry picked from commit d309f4e7e37f3795c6d6b150c407d5a9b332854e)

- - - - -
7c78d930 by Matthew Craven at 2024-04-02T15:25:17+05:30
Add @since annotation to Data.Data.mkConstrTag

(cherry picked from commit 249caf0d2345ac2e6046847522bb8f2fff7f8835)

- - - - -
ae4e8004 by Jade at 2024-04-02T15:26:07+05:30
Enhance documentation of Data.Complex

(cherry picked from commit cdd939e77f2bb20f80310280400b3426598b4eca)

- - - - -
afabec98 by Rodrigo Mesquita at 2024-04-02T15:26:35+05:30
configure: Do not override existing linker flags in FP_LD_NO_FIXUP_CHAINS

(cherry picked from commit 9460d5044b8c7239fb7a6ce875d084617f159c7f)

- - - - -
2ca013d7 by Teo Camarasu at 2024-04-02T15:26:51+05:30
rts: only collect live words in nonmoving census when non-concurrent

This avoids segfaults when the mutator modifies closures as we examine
them.

Resolves #24393

(cherry picked from commit 84357d1143fe4f9076253160f78fac6c2acc8e5b)

- - - - -
622d76d6 by j at 2024-04-02T15:31:35+05:30
Disable several ignore-warning flags in genapply.

(cherry picked from commit faea4bcdf4e71120a5480530fb1879e4439ed512)

- - - - -
a1bf252e by Cheng Shao at 2024-04-02T15:33:24+05:30
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.

(cherry picked from commit dd4af0e5a4a3af208bdf57e8237d85261eef24f7)

- - - - -
a4767444 by Ben Gamari at 2024-04-02T16:45:26+05:30
hadrian: Generate HSC2HS_EXTRAS variable in bindist installation

We must generate the hsc2hs wrapper at bindist installation time since
it must contain `--lflag` and `--cflag` arguments which depend upon the
installation path.

The solution here is to substitute these variables in the configure
script (see mk/hsc2hs.in). This is then copied over a dummy wrapper in
the install rules.

Fixes #24050.

(cherry picked from commit efcbad2dfd242d0bc2c91da5390fe8456a536cc3)
(cherry picked from commit 2eca9c7afedda0b08316b16b0bfd31c60c201ce6)

- - - - -
b3c2901c by Matthew Pickering at 2024-04-02T16:45:26+05:30
ci: Show --info for installed compiler

(cherry picked from commit c540559cf188625bec668fa6cd94d4f94413d730)
(cherry picked from commit d5246e19ebf9a9ddb8dcf04f513e3d365f9d453d)

- - - - -
f5eaaab5 by Hécate Moonlight at 2024-04-02T16:45:26+05:30
Improve the synopsis and description of base

(cherry picked from commit 0eb2265d816f733094506034ba6285a447ebd3a5)

- - - - -
7d95c980 by Vladislav Zavialov at 2024-04-02T16:45:26+05:30
Fix (~) and (@) infix operators in TH splices (#23748)

8168b42a "Whitespace-sensitive bang patterns" allows GHC to accept
the following infix operators:

	a ~ b = ()
	a @ b = ()

But not if TH is used to generate those declarations:

	$([d| a ~ b = ()
	      a @ b = ()
	    |])

	-- Test.hs:5:2: error: [GHC-55017]
	--    Illegal variable name: ‘~’
	--    When splicing a TH declaration: (~_0) a_1 b_2 = GHC.Tuple.Prim.()

This is easily fixed by modifying `reservedOps` in GHC.Utils.Lexeme

(cherry picked from commit 46fd8ced0cc031f2e50a1a4b348738fd39b4a741)

- - - - -
d74ffbbb by Fendor at 2024-04-15T12:31:20+05:30
Escape multiple arguments in the settings file

Uses responseFile syntax.

The issue arises when GHC is installed on windows into a location that
has a space, for example the user name is 'Fake User'.
The $topdir will also contain a space, consequentially.
When we resolve the top dir in the string `-I$topdir/mingw/include`,
then `words` will turn this single argument into `-I/C/Users/Fake` and
`User/.../mingw/include` which trips up the flag argument parser of
various tools such as gcc or clang.
We avoid this by escaping the $topdir before replacing it in
`initSettngs`.
Additionally, we allow to escape spaces and quotation marks for
arguments in `settings` file.

Add regression test case to count the number of options after variable
expansion and argument escaping took place.
Additionally, we check that escaped spaces and double quotation marks are
correctly parsed.

(cherry picked from commit 31bf85ee49fe2ca0b17eaee0774e395f017a9373)

- - - - -
a5a7a0ce by Florian Weimer at 2024-04-15T12:31:20+05:30
Fix C output for modern C initiative

GCC 14 on aarch64 rejects the C code written by GHC with this kind of
error:

   error: assignment to ‘ffi_arg’ {aka ‘long unsigned int’} from ‘HsPtr’ {aka ‘void *’} makes integer from pointer without a cast [-Wint-conversion]
         68 | *(ffi_arg*)resp = cret;
            |                 ^

Add the correct cast.

For more information on this see:
https://fedoraproject.org/wiki/Changes/PortingToModernC

Tested-by: Richard W.M. Jones <rjones at redhat.com>
(cherry picked from commit 1f534c2e7388273e70534680212c1357614c11ed)

- - - - -
af368514 by Rodrigo Mesquita at 2024-04-15T12:31:20+05:30
configure: Use LDFLAGS when trying linkers

A user may configure `LDFLAGS` but not `LD`. When choosing a linker, we
will prefer `ldd`, then `ld.gold`, then `ld.bfd` -- however, we have to
check for a working linker. If either of these fail, we try the next in
line.

However, we were not considering the `$LDFLAGS` when checking if these
linkers worked. So we would pick a linker that does not support the
current $LDFLAGS and fail further down the line when we used that linker
with those flags.

Fixes #24565, where `LDFLAGS=-Wl,-z,pack-relative-relocs` is not
supported by `ld.gold` but that was being picked still.

(cherry picked from commit 32a8103f3b3e22907fdd67b69c919c5251d8cc20)

- - - - -
7ca2ca58 by Cheng Shao at 2024-04-15T12:31:21+05:30
libffi-tarballs: bump libffi-tarballs submodule to libffi 3.4.6

This commit bumps the libffi-tarballs submodule to libffi 3.4.6, which
includes numerous upstream libffi fixes, especially
https://github.com/libffi/libffi/issues/760.

(cherry picked from commit 810660b780e1111b36c91326bcd0041e1f62706b)

- - - - -
291db356 by Cheng Shao at 2024-04-15T12:31:21+05:30
rts: fix clang compilation on aarch64

This patch fixes function prototypes in ARMOutlineAtomicsSymbols.h
which causes "error: address argument to atomic operation must be a
pointer to _Atomic type" when compiling with clang on aarch64.

(cherry picked from commit 7db8c9927fae3369fc4ecff68f80c4cb32eea757)

- - - - -
014e9ad9 by Cheng Shao at 2024-04-15T12:31:21+05:30
testsuite: add the req_process predicate

This patch adds the req_process predicate to the testsuite to assert
the platform has a process model, also marking tests that involve
spawning processes as req_process. Also bumps hpc & process submodule.

(cherry picked from commit ce580426ce3052e3b3d2847d0312652ea9087994)

- - - - -
cd3a199f by Jade at 2024-04-15T12:31:21+05:30
Improve documentation of Semigroup & Monoid

This commit aims to improve the documentation of various symbols
exported from Data.Semigroup and Data.Monoid

(cherry picked from commit fa4e5913251786f2b535b31abd3fad39da8b3602)

- - - - -
b895d534 by Simon Peyton Jones at 2024-04-15T12:31:21+05:30
Make decomposeRuleLhs a bit more clever

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

(cherry picked from commit ca2e919ecca35db412e772d7eadd6a7c4fb20e4b)

- - - - -
49c2986e by Teo Camarasu at 2024-04-15T12:31:21+05:30
rts: avoid checking bdescr of value outside of Haskell heap

In nonmovingTidyWeaks we want to check if the key of a weak pointer
lives in the non-moving heap. We do this by checking the flags of the
block the key lives in. But we need to be careful with values that live
outside the Haskell heap, since they will lack a block descriptor and
looking for one may lead to a segfault. In this case we should just
accept that it isn't on the non-moving heap.

Resolves #24492

(cherry picked from commit 74b24a9b0084459b8aa426a502956bd332b4d0fb)

- - - - -
3a2dfe28 by Zubin Duggal at 2024-04-15T12:31:21+05:30
Bump filepath submodule to 1.4.300.1
Bump directory submodule to 1.3.8.4
Bump process submodule to 1.6.18.0

- - - - -
753131c5 by Zubin Duggal at 2024-04-15T12:31:21+05:30
Bump process submodule to 1.6.19.0

- - - - -
dd41d36f by Zubin Duggal at 2024-04-15T14:33:41+05:30
Disable `-fasm-shortcutting` on -O2 and warn about its usage.

This flag is known to result in unsound optimisations potentially resulting in
incorrect runtime behaviour (#24507).

(cherry picked from commit 4ae8d89e376d79b4188c61e6469c7f01d8445768)

- - - - -
ea08f128 by Zubin Duggal at 2024-04-15T14:33:41+05:30
Bump Cabal submodule to 3.10.3.0

- - - - -
252188bb by Zubin Duggal at 2024-04-15T14:33:41+05:30
Cherry pick

* Fix some primitives defined in GHC.JS.Prim

from

Base/JS: GHC.JS.Foreign.Callback module (issue 23126)

(cherry picked from commit 27d2978e5412f2bef4448e208182a03137dd5ee8)

- - - - -
650c34ab by Zubin Duggal at 2024-04-15T14:35:36+05:30
Prepare release 9.6.5

Metric Increase:
    MultiLayerModulesTH_Make

Metric Decrease:
    MultiLayerModulesTH_Make

- - - - -


30 changed files:

- .gitlab/ci.sh
- compiler/GHC.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/Unify.hs
- compiler/GHC/Data/Graph/Directed.hs
- compiler/GHC/Driver/Config/CmmToAsm.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Foreign/C.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Settings/IO.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/StgToCmm/Heap.hs
- compiler/GHC/StgToCmm/Monad.hs
- compiler/GHC/StgToCmm/Sequel.hs
- compiler/GHC/Utils/Lexeme.hs
- configure.ac
- distrib/configure.ac.in
- docs/users_guide/9.6.3-notes.rst
- docs/users_guide/9.6.4-notes.rst
- + docs/users_guide/9.6.5-notes.rst
- docs/users_guide/bugs.rst
- docs/users_guide/release-notes.rst
- docs/users_guide/runtime_control.rst
- docs/users_guide/using-optimisation.rst


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3187fc7644a41c182ec35292389b61bc0575e80b...650c34ab4e1cefb521209b143ecd75367ec03ee1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/3187fc7644a41c182ec35292389b61bc0575e80b...650c34ab4e1cefb521209b143ecd75367ec03ee1
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/20240415/10863b12/attachment-0001.html>


More information about the ghc-commits mailing list