From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: Marc Lehmann Cc: egcs@cygnus.com Subject: Re: question regarding asm() Date: Wed, 15 Oct 1997 21:03:00 -0000 Message-id: <13876.876974734@hurl.cygnus.com> References: X-SW-Source: 1997-10/msg00625.html In message < E0xIhvT-00067k-00.1997-10-08-00-16-23_pgcc_forever@cerebro >you write: > David Edelsohn wrote: > > Clobber just means that GCC cannot make assumptions about the > >register after the call, not before. > > That's what I expected, but the docs seems to sugest otherwise.. Why do you think that? I've always thought the same as David Edelsohn about clobbers. Given this asm: asm ("movl %0,r9;movl %1,r10;call _foo" : /* no outputs */ : "g" (from), "g" (to) : "r9", "r10"); GCC should avoid allocating any of the inputs to the clobbered registers. However, on some ports, when there aren't enough registers, GCC can't do this, and in some cases it can't even tell you that it did something wrong. This is especially important on machines with weird register sets like the x86. This is _precisely_ why I've told folks in the past to avoid sucking up all the registers for asms -- particularly Linux folk who seem to write bigger asms than anyone. jeff