[fpc-devel] FPC ARM7 problems

Sergio Flores relfos at gmail.com
Thu Aug 7 15:45:09 CEST 2014

I see guys, lots of useful info!
I did not know that optimizations where switchable per unit, that is quite
interesting and I can probably use it to better isolate the problem.
I will also try disabling peephole optimisations then, it can probably work
as a temporary fix to let me use all other optimizations.

Any clue how I could work around for that assembler problem in 2.7.1. Could
breaking the source file into smaller units help?

And Jonas, yes, I could apply a binary logic, I'll see. But I think I know
the unit where the problematic code happens as I did lots of debugging
those last days and found a function that did not crash but did corrupt the
memory when optimizations were on. Maybe just disabling optimizations for
this specific unit or the other units that this one uses could be enough.

Basically what seems to happen is the following, you have two method calls
to the same object.


Calling A does not crash the program, nor does it read or write any invalid
memory. However after method A exits normally and the code goes to call
B(), X strangely is no longer valid, as if A() somehow changed the value of
X, and thus calling X.B() crashes.

I don't have the knowledge of how the internals work, so I don't know how a
function can actually modify the value of "self". I guess some stack
corruption is happening somehow?

This is what I've discovered, not sure if it helps, maybe I could provide
the asm code of that specific method with and without optimizations?

PS: I have no clue in the ammount of work necessary to add dwarf/lineinfo
support to those platforms, but in case it is something doable without too
much work, and can benefit both OSX and iOS, I'm willing to donate some
money to have have such support implemented.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140807/30d41a9f/attachment.html>

More information about the fpc-devel mailing list