This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc and x86 condition codes
- From: Amitabha Roy <aroy dot mailbox at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 1 Jul 2009 22:56:26 +0100
- Subject: gcc and x86 condition codes
Hi
I am working on transforming x86 binaries generated with gcc and
wanted to know whether gcc treats the eflags register as a single unit
when generating code or actually tracks individual flags.
My question is motivated by an optimisation I am making in my tool
that assumes that any instruction that writes to the eflags register
kills it and no subsequent instructions can try to access any flags
not written by this instruction. Is this assumption correct in current
gcc (>= 4.0.0). A search led me to this message
http://gcc.gnu.org/ml/gcc/2005-11/msg00206.html
which says that it is true, or at least was true back then.
Cheers
-Amitabha