[Issue 5294] -O optimization breaks for loop
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Dec 1 12:48:34 PST 2010
http://d.puremagic.com/issues/show_bug.cgi?id=5294
bearophile_hugs at eml.cc changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bearophile_hugs at eml.cc
--- Comment #1 from bearophile_hugs at eml.cc 2010-12-01 12:47:01 PST ---
Reduced a little:
import core.stdc.stdio: printf;
void foo(int) {}
void main() {
int count;
for (int i = 0; i < 2; i++) {
count++;
foo(i * 5 - 6); // comment this out and it makes 2 loops
}
printf("%d\n", count); // compile with -O and it prints 1
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list