Re: Register constrained variable issue

2011-10-13 Thread Richard Henderson
On 10/13/2011 12:26 AM, Zoltán Kócsi wrote: > So I don't know if it is a bug (i.e. the compiler is supposed to protect local > reg vars) or just misleading/omitted information in the info page? It's the documentation that could perhaps be improved. Local register variables are not protected from

Register constrained variable issue

2011-10-13 Thread Zoltán Kócsi
If one writes a bit of code like this: int foo( void ) { register int x asm( "Rn" ); asm volatile ( "INSN_A %0 \n\t" : "=r" (x) ); bar(); asm volatile ( "INSN_B %0,%0 \n\t" : "=r" (x) : "0" (x) ); return x; } and Rn is a register not saved over function calls, then gcc does not save it b