On Tue, Sep 23, 2014 at 04:20:16PM +0800, Bin Meng wrote: > Hi Richard, > > On Tue, Sep 23, 2014 at 4:09 PM, Richard Biener > <richard.guent...@gmail.com> wrote: > > Your asm constraints do not specify that they use %edx. > > > > Richard. > > > > Sorry, I don't understand. The %edx is not used by the inline assembly codes. > The 'mov (%eax),%edx' corresponds to C code: > > pcall = (PCALL)(r->a + r->b); > > where the %edx holds the value of r->a.
You are doing a call in the inline-asm behind compiler's back, and some registers are call clobbered in the ABI. So, unless you call a very special function written in assembly that doesn't clobber those registers (basically, uses a custom calling convention), you need to tell the compiler that your inline-asm clobbers all call clobbered registers in the inline-asm pattern. That is not just about general purpose registers, but e.g. SSE registers or i387 registers are clobbered too. Jakub