The bug in nadd.pas, last detailed in issue 0034385 which was today marked as "fixed", is not in fact in any way fixed.
Original Reporter info from Mantis: Akira1364
-
Reporter name:
Original Reporter info from Mantis: Akira1364
- Reporter name:
Description:
It is actually worse now with an unmodified checkout of the latest trunk, in that you cannot even bootstrap the compiler from source (at least on x86_64 Windows by my tests so far) without the first-stage newly-built version crashing halfway through the process.
Again, this is absolutely without a doubt specifically caused by two particular code changes:
Line 380 of nadd.pas used to look like the following:
function is_range_test(nodel, noder: taddnode; out value: tnode; var cl,cr: QWord): boolean;
It now looks like this:
function is_range_test(nodel, noder: taddnode; out value: tnode; var cl,cr: Tconstexprint): boolean;
Line 463 of nadd.pas used to look like this:
cr, cl : QWord;
It now looks like this:
cr, cl : Tconstexprint;
In both cases as is very obvious it's a matter of a QWord -> Tconstexprint change, that as far as I can tell is most likely failing at some point due to the general flakiness of FPCs ability to distinguish between large signed and unsigned numbers (as in Int64 vs. QWord, the two parts of Tconstexprint.)
The bottom line is that this change simply does not work in the "common case" on x86 or x86_64 (across multiple OSes) as has been observed by multiple people. The especially frustrating thing is that it's entirely unclear as to specifically what the original intended purpose of the change even was, as it was accompanied by nothing other than a cryptic note saying "avoid range checks".
Avoid range checks on which platform? Avoid rang checks on which operating system? Clearly avoid them without any degree of testing the side effects of the change on all other platforms than that one, at the very least!
Steps to reproduce:
Self explanatory.
Mantis conversion info:
- Mantis ID: 34565
- OS: Windows
- OS Build: 10
- Build: 40345
- Platform: x86_64
- Version: 3.3.1