Hi,
On 26.11.2020 17:34, J. Gareth Moreton via fpc-devel wrote:
Hi everyone,
So a couple of people have reported that -O2 sometimes produces bad code under x86_64. So far it seems isolated to that
CPU.
https://bugs.freepascal.org/view.php?id=38129
After my own investigations with the attached code, the problem still occurs even if the peephole optimizer is disabled,
and the uninitialised register is being allocated within conditional code that is not always executed, rather than
before or after it.
Anyone with any tips on where to dig next (register allocator, node converter
etc.) would be most appreciated!
First compile with the "-Ooregvar -alr -sr" switches. You will get the assembler output with imaginary registers and
notes about register allocations and de-allocations. Inspect if all is correct at this stage. If not then the a code
generator of some node is buggy.
Then compile with "-Ooregvar -alr". If the issue is present only at this stage,
then the bug is in the register allocator.
Yuriy.
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel