Commit b05a046f authored by yb9976's avatar yb9976
Browse files

Do not change the condition code of an ia32 test instruction.

This fixes backend/setcc.c.
parent 5bc3ca43
......@@ -761,6 +761,11 @@ static x86_condition_code_t determine_final_cc(const ir_node *node,
const ia32_attr_t *flags_attr;
flags = skip_Proj(flags);
/* Permuted operands of a test instruction do not change the result. */
if (is_ia32_Test(flags)) {
return cc;
}
if (is_ia32_Sahf(flags)) {
ir_node *cmp = get_irn_n(flags, n_ia32_Sahf_val);
if (!(is_ia32_FucomFnstsw(cmp) || is_ia32_FucomppFnstsw(cmp) || is_ia32_FtstFnstsw(cmp))) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment