From 64a40a7bb33b55a2c0503ef93908dc33896f37d0 Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Fri, 22 May 2015 12:51:34 +0000 Subject: [PATCH] [ARM] Handle UNSPEC_VOLATILE in rtx costs and don't recurse inside the unspec * config/arm/arm.c (arm_new_rtx_costs): Handle UNSPEC_VOLATILE. (arm_unspec_cost): Allow UNSPEC_VOLATILE. Do not recurse inside unknown unspecs. From-SVN: r223558 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/arm.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ee48b8e8bc1..2b04e563d26 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-05-22 Kyrylo Tkachov + + * config/arm/arm.c (arm_new_rtx_costs): Handle UNSPEC_VOLATILE. + (arm_unspec_cost): Allow UNSPEC_VOLATILE. Do not recurse inside + unknown unspecs. + 2015-05-22 Richard Biener PR tree-optimization/66251 diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 6d8d060fc63..fa9543138bc 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -9253,7 +9253,8 @@ static bool arm_unspec_cost (rtx x, enum rtx_code /* outer_code */, bool speed_p, int *cost) { const struct cpu_cost_table *extra_cost = current_tune->insn_extra_cost; - gcc_assert (GET_CODE (x) == UNSPEC); + rtx_code code = GET_CODE (x); + gcc_assert (code == UNSPEC || code == UNSPEC_VOLATILE); switch (XINT (x, 1)) { @@ -9299,7 +9300,7 @@ arm_unspec_cost (rtx x, enum rtx_code /* outer_code */, bool speed_p, int *cost) *cost = COSTS_N_INSNS (2); break; } - return false; + return true; } /* Cost of a libcall. We assume one insn per argument, an amount for the @@ -10855,6 +10856,7 @@ arm_new_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer_code, *cost = LIBCALL_COST (1); return false; + case UNSPEC_VOLATILE: case UNSPEC: return arm_unspec_cost (x, outer_code, speed_p, cost); -- 2.30.2