The app works fine if I add the volatile prefix before the variable declaration. inline void pincrement(volatile int* target) { __asm__ __volatile__ ("pushl %%eax":::); __asm__ __volatile__ ("lock ; incl (%%eax)" :"=m"(target):"a"(target)); __asm__ __volatile__ ("popl %%eax":::"eax"); } inline void pdecrement(volatile int* target) { __asm__ __volatile__ ("pushl %%eax":::); __asm__ __volatile__ ("lock ; decl (%%eax)" :"=m"(target):"a"(target)); __asm__ __volatile__ ("popl %%eax":::"eax"); } int main() { volatile int my_an = 0; pincrement(&my_an); pincrement(&my_an); pincrement(&my_an); pdecrement(&my_an); printf("my_an is %d\n",my_an); return 0; } -- View this message in context: http://old.nabble.com/Help%21-Program-crashed-when-call-the-inline-assembly-function-continuously-tp28094526p28107792.html Sent from the gcc - Help mailing list archive at Nabble.com.