My code is written in C++, and compiled with gcc version 4.7.2. It's linked with 3rd party library, which is written in C, and compiled with gcc 4.5.2. My code calls a function initStuff(). During the debug I found out that the value of R15 register before the call to initStuff() is not the same as the value upon return from that function. As a quick hack I did:
asm(" mov %%r15, %0" : "=r" ( saveR15 ) );
initStuff();
asm(" mov %0, %%r15;" : : "r" (saveR15) );
which seems to work for now. Who is to blame here? How can I find if it's a compiler issue, or maybe compatibility issue?