Hello! As shown in the PR [1], RTX costs can reject combination of the operation and its embedded comparison. Attached patch fixes this by ignoring the cost of embedded comparison.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65871#c10 2015-06-22 Uros Bizjak <ubiz...@gmail.com> PR target/65871 * config/i386/i386.c (ix86_rtx_costs) <case COMPARE>: Ignore the cost of embedded comparison. Bootstrapped on x86_64-linux-gnu, regtest in progress. Uros.
Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 224718) +++ config/i386/i386.c (working copy) @@ -42531,6 +42531,12 @@ ix86_rtx_costs (rtx x, int code_i, int outer_code_ + rtx_cost (const1_rtx, outer_code, opno, speed)); return true; } + + /* The embedded comparison operand is completely free. */ + if (!general_operand (XEXP (x, 0), GET_MODE (XEXP (x, 0))) + && XEXP (x, 1) == const0_rtx) + *total = 0; + return false; case FLOAT_EXTEND: