From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Lehmann To: egcs@cygnus.com Subject: question regarding asm() Date: Fri, 03 Oct 1997 18:13:00 -0000 Message-id: X-SW-Source: 1997-10/msg00182.html in the info file, this asm is given as an example of specifying registers to be clobbered: > asm ("movl %0,r9;movl %1,r10;call _foo" > : /* no outputs */ > : "g" (from), "g" (to) > : "r9", "r10"); Now I have a question.. is gcc supposed to avoid allocating r9 to %1 ?? in fact, gcc tries to avoid allocating "clobbered" registers for input operands, but if there are no registers left gcc will nevertheless use them. So, under register pressure, gcc might use r9 for input operand %1. There was a problem in the linux kernel because egcs allocated a register for an input operand that was also in the clobberlist (and actually was overwritten before the input operand was used). so whats wrong? a) the example in the documentation b) gcc, because it allocates wrong registers for the input operands c) me, because I'm totally confused tonight.. ;? -----==- ----==-- _ ---==---(_)__ __ ____ __ Marc Lehmann --==---/ / _ \/ // /\ \/ / pcg@goof.com -=====/_/_//_/\_,_/ /_/\_\ The choice of a GNU generation