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

Issue 13485 - FP wrong-code with -O #4394

Merged
merged 1 commit into from Feb 14, 2015
Merged

Conversation

yebblies
Copy link
Member

@yebblies yebblies commented Feb 8, 2015

Converting x += a; x += b to x += a + b; is not valid with floating point types in D.

I'm assuming it is valid with fastfloat enabled, @WalterBright ?

https://issues.dlang.org/show_bug.cgi?id=13485

@9il
Copy link
Member

9il commented Feb 8, 2015

Thanks! I hope this PR unblock dlang/phobos#2513.

@@ -214,6 +214,7 @@ STATIC void local_exp(elem *e,int goal)
em->E1->EV.sp.Vsym == s &&
tysize(em->Ety) == tysize(e1->Ety) &&
em->E1->EV.sp.Voffset == e1->EV.sp.Voffset &&
(config.flags4 & CFG4fastfloat || !tyfloating(em->Ety)) &&
Copy link
Member

Choose a reason for hiding this comment

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

extra parens for clarity?

((config.flags4 & CFG4fastfloat) || !tyfloating(em->Ety)) &&

Copy link
Member Author

Choose a reason for hiding this comment

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

The backend's style is no parens.

@WalterBright
Copy link
Member

Documentation on fastfloat: http://www.digitalmars.com/ctg/sc.html#dashff

No, I don't think it applies. I'd just remove the check for it from the patch.

@yebblies
Copy link
Member Author

Updated.

WalterBright added a commit that referenced this pull request Feb 14, 2015
Issue 13485 - FP wrong-code with -O
@WalterBright WalterBright merged commit 527b3cf into dlang:master Feb 14, 2015
@yebblies yebblies deleted the issue13485 branch February 14, 2015 04:29
@yebblies
Copy link
Member Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants