Hi, On Wed, 18 Oct 2017, Segher Boessenkool wrote:
> Certainly. And to work around the bug, it should work to mention some > hard register as asm input. Ideally something that is live anyway; > perhaps the stack pointer :-) Like so: > > __asm volatile ("mrs %0,PRIMASK" : "=r" (status) :: "sp"); > > (I tested this, it does work around the bug). > > Or hey, why not the program counter, that should make it even clearer > something is funny here: > > __asm volatile ("mrs %0,PRIMASK" : "=r" (status) :: "pc"); > > (also tested, works fine). Both of these are not asm inputs but clobbers, though :) And clobbering "pc" could have funny effects if any of our allocators ever would produce save/restore code around such asms for such clobbers. Ciao, Michael.