[lkml]   [2001]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjecti386 flags register clober in inline assembly

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


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.117 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site