I wanted to point out that this, in particular, is utter nonsense.
Consider a sequence that looks something like this:
if (foo ? bar : imv_cond(var)) {
blah();
}
An entirely sane transformation of this (as far as gcc is concerned), is
something like:
cmpl $0,foo
je 1f
cmpl $0,bar
jmp 2f
1:
#APP
movb var,%al /* This is your imv */
#NO_APP
testb %al,%al
2:
je 3f
call blah
3:
Your code would take the movb-testb-je sequence and combine them, then
we jump into the middle of the new instruction when jumping at 2!
There are only two ways to deal with this - extensive analysis of the
entire flow of control, or telling the compiler exactly what is
*actually* going on. The latter is the preferred way, obviously.
-hpa
--