From 6dfeb7ceac74b61cb71b0c39dc3b02897aeb7087 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Thu, 28 Jan 2016 15:41:46 +0000 Subject: [PATCH] A recent change added UNSPEC to the CCMP patterns to stop combine optimizing the immediate in a rare case. A recent change added UNSPEC to the CCMP patterns to stop combine optimizing the immediate in a rare case. This requires a fix to the CCMP cost calculation as the CCMP instruction with unspec is no longer recognized. Fix the ccmp_1.c test by adding -ffinite-math-only so FCCMPE is emitted on relational compares. 2016-01-28 Wilco Dijkstra gcc/ * config/aarch64/aarch64.c (aarch64_if_then_else_costs): Remove CONST_INT_P check in CCMP cost calculation. gcc/testsuite/ * gcc.target/aarch64/ccmp_1.c: Fix test issue. From-SVN: r232930 --- gcc/ChangeLog | 5 +++++ gcc/config/aarch64/aarch64.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/aarch64/ccmp_1.c | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1967e922798..551dedfc2d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2016-01-28 Wilco Dijkstra + + * config/aarch64/aarch64.c (aarch64_if_then_else_costs): + Remove CONST_INT_P check in CCMP cost calculation. + 2016-01-28 Wilco Dijkstra * config/aarch64/aarch64.c (generic_vector_cost): diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 5b3771eca67..bba7a9b6f42 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -6010,7 +6010,7 @@ aarch64_if_then_else_costs (rtx op0, rtx op1, rtx op2, int *cost, bool speed) else if (GET_MODE_CLASS (GET_MODE (inner)) == MODE_CC) { /* CCMP. */ - if ((GET_CODE (op1) == COMPARE) && CONST_INT_P (op2)) + if (GET_CODE (op1) == COMPARE) { /* Increase cost of CCMP reg, 0, imm, CC to prefer CMP reg, 0. */ if (XEXP (op1, 1) == const0_rtx) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index afc6d6fb6e8..6e5e2188153 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-01-28 Wilco Dijkstra + + * gcc.target/aarch64/ccmp_1.c: Fix test issue. + 2016-01-28 David Edelsohn * gcc.dg/pr65980.c: Skip on AIX. diff --git a/gcc/testsuite/gcc.target/aarch64/ccmp_1.c b/gcc/testsuite/gcc.target/aarch64/ccmp_1.c index 7c39b61a585..fd38b2cfdb8 100644 --- a/gcc/testsuite/gcc.target/aarch64/ccmp_1.c +++ b/gcc/testsuite/gcc.target/aarch64/ccmp_1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -ffinite-math-only" } */ int f1 (int a) -- 2.30.2