Re: Bug when using uint inside loop

2021-10-09 Thread Iain Buclaw via D.gnu
On Saturday, 9 October 2021 at 14:52:47 UTC, Matheus wrote: I saw this problem in C, then I tried on GDC and have the same problem: int main() { for (uint a = 0, b = 0; a < 6; a += 1, b += 2){ if (b < a){ return 1; } } return 0; } The code above generates t

Bug when using uint inside loop

2021-10-09 Thread Matheus via D.gnu
I saw this problem in C, then I tried on GDC and have the same problem: int main() { for (uint a = 0, b = 0; a < 6; a += 1, b += 2){ if (b < a){ return 1; } } return 0; } The code above generates the wrong code when using: -O1, -O2 or -O3: _Dmain: