[Issue 16189] Optimizer bug, with simple test case

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jun 21 18:20:48 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16189

--- Comment #2 from Kirill Kryukov <kkryukov at gmail.com> ---
A possible workaround: change "a--;" into "{ auto a2 = a - 1; a = a2; }".

(This is NOT to suggest that the bug does not need fixing, as it's annoying as
hell that even simplest C-like code does not work correctly.)

As for previous reduction - it hurts my eyes to see size_t (unsigned type)
compared for equality with -1, so I suggest to at least use ptrdiff_t.

--


More information about the Digitalmars-d-bugs mailing list