Compilation fails with assertion in constfold.c:608 or constfold.c:614 for the following code: bool foo(T)(T t) { t >>>= 1; // triggers assertion for ubytes and ushorts // t = t >>> 1; // this compiles with no errors return true; } void main() { auto g1 = foo!ubyte(1); // Ok for runtime auto g2 = foo!ushort(1); // Ok for runtime // CTFE: enum e1 = foo!ubyte(1); // Assertion failure: '0' on line 608 in file 'constfold.c' enum e2 = foo!ushort(1); // Assertion failure: '0' on line 614 in file 'constfold.c' } DMD 2.048
Created attachment 814 [details] PATCH against rev 755: remove superfluous asserts fixed, no idea why asserts where placed in there. unsigned shifting of 8 ^ 16 bit values seems perfectly reasonable.
(In reply to comment #1) > Created an attachment (id=814) [details] > PATCH against rev 755: remove superfluous asserts > > fixed, no idea why asserts where placed in there. > unsigned shifting of 8 ^ 16 bit values seems perfectly reasonable. The problem is that the code there gives different results to what happens in all other situations. See bug 2809. As far as I can tell, >>> is a broken concept. Andrei and I tried to get it removed from the language before publication of TDPL, but we failed.
Mass migration of bugs marked as x86-64 to just x86. The platform run on isn't what's relevant, it's if the app is a 32 or 64 bit app.
https://github.com/D-Programming-Language/dmd/commit/4fa620ba567bdf1c9be09d46d089a9fc364cc9d2 https://github.com/D-Programming-Language/dmd/commit/8f24469bd1cc3b6b33fd539ccf9d8dab3135156f