[fpc-devel] Debugging Loop Unroll Optimization

Florian Klämpfl florian at freepascal.org
Wed May 16 19:20:17 CEST 2018

Am 16.05.2018 um 14:57 schrieb Martok:
> Hi all,
> as we have discovered in 0033576 and 0033614, there is a bug somewhere in the
> loop unroll optimization pass that only appears in complex enough code. The
> problem is, it doesn't happen in the single testsuite test, and the observable
> crashes in Lazarus are caused by memory corruption at some point unrelated to
> the crash, so it's hard to debug (at least on Windows, without rr...).
> I have one other project that has sporadic crashes with -OoLOOPUNROLL (I wish I
> had figured that out back then), but that is about as difficult as Lazarus,
> where it's at least 100% reproducible.
> Does anyone have more complete test cases, or maybe smaller affected projects?

How big is the project? Normally, the number of unrolled loops is reasonable small so comparing the
generated assembler with and without unrolling should be feasible.

More information about the fpc-devel mailing list