[Issue 7774] I've found a bug in D2

2012-03-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7774



--- Comment #4 from Andrey Derzhavin vangelisfore...@yandex.ru 2012-03-25 
23:46:44 PDT ---
(In reply to comment #3)
 You have found a bug in DMD 2.058, not in D2.
 
 
 Smaller test case:
 struct A{
 double x;
 void f(double d){x%=cast(double)d;}
 }
 void main(){
 auto a=A(10);
 a.f(8);
 assert(a.x!=10.0);
 }
 
 Works with DMD 2.059head, fails with DMD 2.058.

How can I get a DMD 2.059 linux version or DMD 2.0?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 7774] I've found a bug in D2

2012-03-26 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7774



--- Comment #5 from timon.g...@gmx.ch 2012-03-26 00:04:47 PDT ---
(In reply to comment #4)
 
 How can I get a DMD 2.059 linux version or DMD 2.0?

It hasn't been released yet, but you can build it from source:
https://github.com/D-Programming-Language/dmd

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 7774] I've found a bug in D2

2012-03-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7774


Dmitry Olshansky dmitry.o...@gmail.com changed:

   What|Removed |Added

 CC||dmitry.o...@gmail.com


--- Comment #1 from Dmitry Olshansky dmitry.o...@gmail.com 2012-03-25 
12:59:59 PDT ---
I'm using your exact code, it works fine here on dmd2.059head win7 and prints 
2 2

Your version of dmd, system spec?

PS: I totally expected thouse ifs to be static ifs.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 7774] I've found a bug in D2

2012-03-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7774


bearophile_h...@eml.cc changed:

   What|Removed |Added

 CC||bearophile_h...@eml.cc


--- Comment #2 from bearophile_h...@eml.cc 2012-03-25 13:06:05 PDT ---
If confirmed this bug report needs a better name :-)

(In reply to comment #1)
 PS: I totally expected thouse ifs to be static ifs.

Those variables are known at compile-time, so a good compiler is supposed to
remove the useless if branches (quite probably dmd does it).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 7774] I've found a bug in D2

2012-03-25 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=7774


timon.g...@gmx.ch changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||timon.g...@gmx.ch
 Resolution||WORKSFORME


--- Comment #3 from timon.g...@gmx.ch 2012-03-25 13:48:49 PDT ---
You have found a bug in DMD 2.058, not in D2.


Smaller test case:
struct A{
double x;
void f(double d){x%=cast(double)d;}
}
void main(){
auto a=A(10);
a.f(8);
assert(a.x!=10.0);
}

Works with DMD 2.059head, fails with DMD 2.058.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---