<p>Am 07.08.2014 14:09 schrieb "Sergio Flores" <<a href="mailto:relfos@gmail.com">relfos@gmail.com</a>>:<br>
><br>
> I have a somehow big pascal game (more than 200k lines of code) that I'm developing with FPC.<br>
> Right now I found a strange crashing bug that only happened in iOS, running in the device (in the iOS simulator does not crash). Desktop platforms don't have any problems running the same code (Windows, Linux etc). <br>
> In Android I'm not sure, because while it does not crash in my devices, in many players devices the game just crashes in that exact spot.<br>
><br>
> So I have some questions.<br>
><br>
> 1 - This bug only happens with -O2 on, but with optimizations off the game does not crash. I always thought that using optimizations was safe. Can there be a compiler bug in the ARM7 codegen? <br>
> Lately I've been shipping the game without optimizations, but of course, this means less performance.<br>
> I thought that the bug could be caused by differences in memory allocations on those different OSes, but I'm not sure.<br>
> Anyone has a clue how to discover the difference between O2 and O- that could cause such problems?</p>
<p>It can indeed be that there is a bug in the optimizer. Does it also happen with -O1? Does it also happen when you switch on single optimizations (-OoSpecificOptimization)? AFAIR a list of available optimizations can be queried by "fpc -Parm -i" (among other information).</p>
<p>Regards,<br>
Sven</p>