Re: i386 flags register clober in inline assembly

From: H. Peter Anvin (hpa@zytor.com)
Date: Sat Nov 17 2001 - 16:00:17 EST


Followup to: <20011117214041.D3789@atrey.karlin.mff.cuni.cz>
By author: Jan Hubicka <jh@suse.cz>
In newsgroup: linux.dev.kernel
>
> Actually the main dificulty I see is storing cc0 to variable. CC0 is hard
> register and pretty strange one - you can't move it, you can't spill. Using
> the syntax above you can easilly make cc0 from asm statement to span another
> cc0 set resulting in incorrect code or compiler crash.
> (the code generator may insert any code in between statements as it don't
> know he can't clobber cc0. In fact this is happening in from of if
> construct as deffered stack deallocators are flushed).
>

Why can't you move or spill it? There are a whole lot of ways you
could do either: pushf, sahf, setcc...

        -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Nov 23 2001 - 21:00:16 EST