Skip to content
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

fix Issue 21772 - [REG2.069] Consecutive different-signed double.nans… #14727

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

WalterBright
Copy link
Member

… in an array literal take the sign of the previous nan (same for float and real)

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
21772 regression [REG2.069] Consecutive different-signed double.nans in an array literal take the sign of the previous nan (same for float and real)

⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️

To target stable perform these two steps:

  1. Rebase your branch to upstream/stable:
git rebase --onto upstream/stable upstream/master
  1. Change the base branch of your PR to stable

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14727"

Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot says regressions should target stable

compiler/src/dmd/e2ir.d Outdated Show resolved Hide resolved
@WalterBright WalterBright force-pushed the fix21772 branch 2 times, most recently from eece9c1 to 3a49904 Compare December 20, 2022 22:33
@WalterBright WalterBright force-pushed the fix21772 branch 5 times, most recently from 266a4c5 to 4ba6cb6 Compare December 21, 2022 07:17
@ibuclaw
Copy link
Member

ibuclaw commented Dec 21, 2022

Testing all versions of gdc from 9..12, I don't get the same bug as dmd here, CTFE values look fine too.

$ gdc r.d -o gdc-r
[-QNaN, +QNaN, +QNaN, 1.0e+0, +QNaN, -QNaN]
$ ./gdc-r
[-nan, nan, nan, 1, nan, -nan]

vs. dmd

$ dmd r.d -o dmd-r
[-nan, nan, nan, 1.0, nan, -nan]
$ ./dmd-r
[-nan, -nan, -nan, 1, nan, nan]
core.exception.AssertError@r.d(11): Assertion failure

So I'm not entirely sure if the CTFE changes are required here for fixing this bug.

Also bearing in mind that CTFE nan !is -nan was fixed in #13780.

… in an array literal take the sign of the previous nan (same for float and real)
Copy link
Contributor

@dkorpel dkorpel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, the issue is not actually a regression. It was always wrong, writlen just didn't print -nan before 2.069

@dlang-bot dlang-bot merged commit 0a7502f into dlang:master Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants