public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* i386, asm and forbidden spilled registers...
@ 1998-10-30 14:39 Krister Walfridsson
  1998-10-31  2:52 ` Jeffrey A Law
  1998-11-01  2:30 ` Horst von Brand
  0 siblings, 2 replies; 4+ messages in thread
From: Krister Walfridsson @ 1998-10-30 14:39 UTC (permalink / raw)
  To: egcs

I tried to compile the NetBSD i386 kernel with a egcs built from todays
source. Egcs complains on most asm statements, but I don't understand
why...

For example, the following code gives the error

foo.c:7: Invalid `asm' statement:
foo.c:7: fixed or forbidden register 2 (cx) was spilled for class CREG.


static __inline void
insb(int port, void *addr, int cnt)
{
  	__asm __volatile("cld\n\trepne\n\tinsb"			:
								:
			 "d" (port), "D" (addr), "c" (cnt)	:
			 "%edi", "%ecx", "memory");
}

void
foo(void)
{
  insb(0,0,0);
}


Are there some kind of documentation somewhere how to write correct asm
statements? I didn't find anything relevant in the gcc info files...

   /Krister


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-11-03 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-30 14:39 i386, asm and forbidden spilled registers Krister Walfridsson
1998-10-31  2:52 ` Jeffrey A Law
1998-11-01  2:30 ` Horst von Brand
1998-11-03 21:28   ` Jeffrey A Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).