[Issue 326] New: calculation bug

Thomas Kuehne thomas-dloop at kuehne.cn
Thu Sep 7 00:59:31 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail at puremagic.com schrieb am 2006-09-06:
> http://d.puremagic.com/issues/show_bug.cgi?id=326

> To compile this code with '-release -O' brings a incorrect calculation.
>
> import std.stdio;
>
> int x = 2, y = 1;
>
> void main() {
> int res = 0;
> for(int i = 0; i < 10; i++) {
> res = res + x - y;
> writefln(res);
> }
> }

Added to DStress as
http://dstress.kuehne.cn/run/o/odd_bug_08_A.d
http://dstress.kuehne.cn/run/o/odd_bug_08_B.d
http://dstress.kuehne.cn/run/o/odd_bug_08_C.d
http://dstress.kuehne.cn/run/o/odd_bug_08_D.d
http://dstress.kuehne.cn/run/o/odd_bug_08_E.d
http://dstress.kuehne.cn/run/o/odd_bug_08_F.d
http://dstress.kuehne.cn/run/o/odd_bug_08_H.d
http://dstress.kuehne.cn/run/o/odd_bug_08_I.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFE/81ELK5blCcjpWoRAi9CAJ0eCrTu5PYdh2ZntTOvLxArdjFmZACfWufb
ieqAan4Y85X4k3uszBIu3+g=
=aL0Z
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list