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 17087 - [REG2.072] Wrong generated with cfloat and creal wh… #6460

Merged
merged 1 commit into from
Jan 18, 2017

Conversation

WalterBright
Copy link
Member

…en casting from int

Looks like the problem was a very old copy/pasta error.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
17087 [REG2.072] Wrong generated with cfloat and creal when casting from int

@@ -4411,7 +4411,7 @@ elem *toElem(Expression e, IRState *irs)
case X(Tfloat64,Tcomplex32):
case X(Tfloat64,Tcomplex64):
case X(Tfloat64,Tcomplex80):
e = el_bin(OPadd,TYcfloat,el_long(TYidouble,0),e);
e = el_bin(OPadd,TYcdouble,el_long(TYidouble,0),e);
Copy link
Member

Choose a reason for hiding this comment

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

Why is cdouble more correct that cfloat? This seems to cover float, double and real.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because its operands are double, and the next line assumes its type is cdouble.

@MartinNowak MartinNowak changed the base branch from master to stable January 17, 2017 23:36
@MartinNowak
Copy link
Member

MartinNowak commented Jan 17, 2017

Auto-merge toggled on (after rebasing onto stable).

@MartinNowak MartinNowak merged commit 3c0b769 into dlang:stable Jan 18, 2017
@WalterBright WalterBright deleted the fix17087 branch January 18, 2017 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity:Regression PRs that fix regressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants