I have a loop like this:
i = 0;
...
while (i < s.length && s[i] != '"')
{
...
tmp ~= s[i];
++i;
}
Usually it works great. When I use the -O flag, it sometimes crashes, but if I write it like this:
char c;
...
tmp ~= c = s[i];
... then it works great again. I don't see any reason for this strange behavior, except of optimizer's tricks.
Comment #1 by kolos80 — 2008-06-17T07:34:20Z
Sorry for mistake. It's -release option's blame, but it's still a bug :)
Comment #2 by clugdbug — 2008-06-30T08:02:41Z
Create a complete example showing the problem. Otherwise this will never get fixed.
Comment #3 by clugdbug — 2009-09-20T12:32:16Z
This is probably just incorrect code, with memory corruption, and it's just "luck" that it works without -release. Marking as invalid since there's no test case, and there's an probable explanation which doesn't involve a compiler bug.