Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 183904) +++ config/i386/i386.c (working copy) @@ -38685,6 +38685,9 @@ #undef TARGET_EXPAND_TO_RTL_HOOK #define TARGET_EXPAND_TO_RTL_HOOK ix86_maybe_switch_abi +#undef TARGET_FLAGS_REGNUM +#define TARGET_FLAGS_REGNUM FLAGS_REG + #undef TARGET_LEGITIMATE_ADDRESS_P #define TARGET_LEGITIMATE_ADDRESS_P ix86_legitimate_address_p Index: testsuite/gcc.target/i386/pr28685.c =================================================================== --- testsuite/gcc.target/i386/pr28685.c (revision 0) +++ testsuite/gcc.target/i386/pr28685.c (revision 0) @@ -0,0 +1,12 @@ +/* { dg-options "-O2" } */ + +int test(int a, int b) +{ + int lt = a < b; + int eq = a == b; + if (lt) + return 1; + return eq; +} + +/* { dg-final { scan-assembler-times "cmp" 1 } } */