[ARM] Handle UNSPEC_VOLATILE in rtx costs and don't recurse inside the unspec
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Fri, 22 May 2015 12:51:34 +0000 (12:51 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Fri, 22 May 2015 12:51:34 +0000 (12:51 +0000)
* 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
gcc/config/arm/arm.c

index ee48b8e8bc1f611b4dc4e4c22ec84ec39e98026a..2b04e563d26451860eb4fb2dc3ce2167f076da79 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-22  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
+
+       * 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  <rguenther@suse.de>
 
        PR tree-optimization/66251
index 6d8d060fc63e31fc0e73a8f01fab3cfaa6456441..fa9543138bcc60490f4e0bbf31e10caeff58c7e5 100644 (file)
@@ -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);