In GCC inline assembly, there are two ways to prevent from being optimized-out: __volatile__
keyword and inserting "memory"
into clobber registers list.
My question is what is difference from __volatile__
and "memory"
- It seems that they're the same... However, today I faced the strange situation, which shows they're definitely different! (My program had a bug in port I/O functions when I used "memory"
, but it becomes fine when I used __volatile__
.)
What's the difference?