• Tor Lillqvist's avatar
    Be truthful to the compiler about registers clobbered by asm snippet · b3aad508
    Tor Lillqvist yazdı
    The asm code loads values into parameter-passing registers r0-r3.
    (That is one of the very purposes of the asm snippet.) We need to tell
    the compiler that. The compiler does not analyze the asm snippet and
    has no idea by itself what it does.
    
    Otherwise the compiler might well put one of the input values to the
    asm snippet, like the "pmethod" (the value of the pMethod variable)
    into one of those registers, so that when that value then is used in
    the asm snippet, *after* r0-r3 have already been modified, it
    obviously is totally unrelated to pMethod any more, and the result is
    that the code jumps into hyperspace.
    
    Apparently this has worked purely by luck, or thanks to GCC
    conservatively avoiding using the r0-r3 parameter-passing registers in
    this way. The problem was noticed when using the same code with Clang.
    
    The above analysis tentatively confirmed by Caolán and Jani Monoses,
    who wrote the code.
    
    Change-Id: I3018c2e2ccb83e7a71144425fa404ad28bb955d6
    b3aad508
Adı
Son kayıt (commit)
Son güncelleme
..
cpp_uno Loading commit data...
jni_uno Loading commit data...
bridge_exports.map Loading commit data...