Skip to content

Upgrade frontend & libs to v2.111 #4877

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 705 commits into from
Apr 12, 2025
Merged

Upgrade frontend & libs to v2.111 #4877

merged 705 commits into from
Apr 12, 2025

Conversation

kinke
Copy link
Member

@kinke kinke commented Mar 14, 2025

No description provided.

dkorpel and others added 30 commits January 10, 2025 23:57
For both GCC and LLVM, `__builtin_expect` and `llvm_expect` respectively
return an integer, not a boolean. This triggers a compiler error as
implicit narrow conversions are not allowed.
* Use const when possible

* Fix error
handled by allocating an empty array with metadata!
Move all array and finalizer functionality into the GC
…md!20710)

* Fix build on i686, arm64 and x86_64+32b multilib for Darwin.

osthread.d needs to import the thread state definitions for each
supported arch (but was only importing x86_64).

NOTE1: Iain Buclaw pointed out that the ucontext import was unused
and do I have removed that too.

NOTE2: I did not add the data for 32bit Arm (as distinct from the
possible use of AArch64/ILP32), because there is no way I know
to test that - since there's no upstream 32b Arm implementation.

NOTE3: The earlier Darwin versions (equivalent to MacOSX 10.5) have
quite limited D support - but both i686 and PowerPC should be able
(at least) to build the druntime.

I tested on x86_64,i686-Darwin17 and aarch64-darwin23.

Signed-off-by: Iain Sandoe <[email protected]>

* Address code reviews.

---------

Signed-off-by: Iain Sandoe <[email protected]>
Co-authored-by: Iain Buclaw <[email protected]>
@kinke
Copy link
Member Author

kinke commented Mar 24, 2025

Thx for checking! Yeah saw that diff too and thought this was just an old workaround (for a compiler warning); looks like it should be restored, but I'm almost certain it won't fix the problem at hand.

@kinke
Copy link
Member Author

kinke commented Mar 25, 2025

lit-test sanitizers/asan_fiber.d with RT_SUPPORT_SANITIZERS=ON

Little correction: on macOS arm64 at least; Linux x86_64 is fine (tested by 2 CI jobs). So might be Darwin and/or AArch64 specific.

faresbakhit and others added 3 commits March 29, 2025 10:57
* Fix dlang/dmd!21024 - Optimize x^^c expressions

Reason for the *magic* constraint c<8 on inlining x^^c:

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86_64/fpu/e_powl.S;h=47f129f34d368d7c67b8e5f2462b36b0bebb7621;hb=HEAD#l136

* Fix poor assumption about expression state

* Restrict optimization to floating point expressions

* Generalize optimization to any scalar data type

* Fix segfault on x^^c where x is a single member anonymous enum

DMD segfaulted on compiling the unittests in std/algorithm/sorting.o, the
unittest that caused the segfault can be reduced to:

    enum real Two = 2.0;
    auto _ = Two^^3;

I'm not sure why copying the anonymous enum into a `const` variable causes
the compiler to segfault.

* Add tests to x^^c inlining optimization

* Fix missing type for e1 ^^ -1 to 1 / e1 rewrite

* Move rewrites from constant folding to expression semantic and restrict them to [-1, 2]

* Improve error message for the x^^2 rewrite.

Before:
    ex.d(4): Error: can implicitly convert expression `(const const(double) __powtmp2 = x + 5.0;) , __powtmp2 * ...` of type `double` to `int`
        int y = ( x + 5 ) ^^ 2;
                ^
and after:
    ex.d(4): Error: cannot implicitly convert expression `(x + 5.0) ^^ 2L` of type `double` to `int`
        int y = ( x + 5 ) ^^ 2;
                ^

* Update C++ frontend header to match change in `CommaExp`

* Address code review feedback

Co-authored-by: Dennis Korpel <[email protected]>

---------

Co-authored-by: Dennis Korpel <[email protected]>
@kinke
Copy link
Member Author

kinke commented Mar 31, 2025

@JohanEngelen: Do you think you'll find some time to have a look at the remaining issue? Otherwise I'll disable that test for now, to move on.

ibuclaw and others added 5 commits April 6, 2025 07:31
Partially reverts the regressing change in 0a9b845. The "fixed"
refactoring should be applied to master/development branch.
Fixes: dlang/dmd#21183

The previous MR put the macro in a `#if linux` which meant it
didn't actually solve the problem of being unable to
`#include <math.h>` on macos. So put it in a better spot.

Also enable the test that includes that header for macos so that
it stays solved.
@kinke kinke changed the title [WIP] Upgrade frontend & libs to v2.111 Upgrade frontend & libs to v2.111 Apr 9, 2025
@kinke kinke marked this pull request as ready for review April 9, 2025 19:01
dkorpel and others added 4 commits April 10, 2025 07:19
Strips off additional bits that are not part of the actual TLV key to avoid applications using DRuntime crashing during initialization.

Fixes dlang/dmd!21126.
@kinke kinke merged commit e0e7fed into master Apr 12, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.