Saying that, it might not be a bug but a design choice. If the compiler is able to extend the variable to 64 bits on the stack, it will do, including the use of "incq" over "incl" - whenever I try to exploit the upper 32 bits, the compiler is too smart for that!
The only problem is that it can hinder the peephole optimiser, and if I put in an exception that optimises, say, "movl addl movq" to "addl" or "incl" or whatnot, then that could be exploited. I'll have a think in regards to what to do with that one. Gareth aka. Kit On Sat 22/12/18 20:04 , "J. Gareth Moreton" gar...@moreton-family.com sent: Have to apologise again for my web client making life difficult for the mail archive system. Currently I'm a little reluctant to put in the "incq" fix because the code isn't equivalent. More than anything, it's a very minor bug with the node system in that it writes the full 64-bit register instead of the 32-bit register for LongInts and LongWords, it seems. I might be able to exploit the bug in a very narrow range of circumstances, and if I'm able to make a reproducible test case, I'll report it. Nevertheless, if I'm not able to exploit it, it's something that might be worth fixing if only because it will make optimisation easier and correct. Also note that "INC" is generally only generated if you're optimising for size, because modern CPUs work better with "ADD" due to how it modifies the RFLAGS register. For the overhaul in general, I have it ported over to i386 on my working branch, since I've got x86_64 working without any breaking bugs. Even if just for a temporary debugging measure, I'm considering options to allow the writing of node trees to an XML file or some such, since I think this will allow easier debugging of that part of the compiler. Gareth aka. Kit _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org [1] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel [2]">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel Links: ------ [1] mailto:fpc-devel@lists.freepascal.org [2] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel