A patch I posted recently fixes combine to take costs of JUMP_INSNs into account. That causes the pr30315 test to fail with -m32, since the cost of an add that sets the flags is estimated too high.
The following seems to fix it. Bootstrapped and tested on x86_64-linux, ok? Bernd
* config/i386/i386.c (ix86_rtx_costs): For a PLUS inside a COMPARE, representing an add that sets the flags, count just the PLUS. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7115ec44c2a..6e48f5ccbde 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -19500,6 +19500,11 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno, + rtx_cost (const1_rtx, mode, outer_code, opno, speed)); return true; } + if (GET_CODE (XEXP (x, 0)) == PLUS) + { + *total = rtx_cost (XEXP (x, 0), mode, COMPARE, 0, speed); + return true; + } /* The embedded comparison operand is completely free. */ if (!general_operand (XEXP (x, 0), GET_MODE (XEXP (x, 0)))