public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* i386 flags register clober in inline assembly
@ 2001-11-17 14:06 Momchil Velikov
  2001-11-17 15:14 ` Jan Hubicka
  2001-11-17 19:20 ` Linus Torvalds
  0 siblings, 2 replies; 17+ messages in thread
From: Momchil Velikov @ 2001-11-17 14:06 UTC (permalink / raw)
  To: linux-kernel; +Cc: gcc


There are several inline assembly routines in the i386 port, which
clobber the flags register, nevertheless fail to declare that.
E.g. atomic_inc

	__asm__ __volatile__(
		LOCK "incl %0"
		:"=m" (v->counter)
		:"m" (v->counter));

should be

	__asm__ __volatile__(
		LOCK "incl %0"
		:"=m" (v->counter)
		:"m" (v->counter)
                : "cc");

since "incl" clobbers flags.

Any ideas if these functions should be corrected ?

Although gcc documentation says "cc" has no effect on some machines,
it seems this is not the case with i386, judging from the "(set (reg:CC 17) ..."
and "(clobber (reg:CC 17))" in i386.md.

Regards,
-velco



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

end of thread, other threads:[~2001-11-23 22:27 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-11-17 14:06 i386 flags register clober in inline assembly Momchil Velikov
2001-11-17 15:14 ` Jan Hubicka
2001-11-17 19:20 ` Linus Torvalds
2001-11-17 19:58   ` H. Peter Anvin
2001-11-17 20:24   ` Momchil Velikov
2001-11-17 20:30     ` Linus Torvalds
2001-11-17 20:40   ` Jan Hubicka
2001-11-17 20:42     ` Linus Torvalds
2001-11-18  1:09       ` Jan Hubicka
2001-11-18  2:48         ` Linus Torvalds
2001-11-20  8:33           ` Richard Henderson
2001-11-20 13:00             ` Jan Hubicka
2001-11-20 23:14               ` Richard Henderson
2001-11-20 17:12             ` Linus Torvalds
2001-11-17 21:00     ` H. Peter Anvin
2001-11-20 14:39   ` PATCH 2.4.15-pre6 idt compilation and proc_misc cleanup Martin Dalecki
2001-11-23 22:24     ` Roman Zippel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox