* rtlanal.c (rtx_cost): Handle TRUNCATE between tieable modes.
authorBin Cheng <bin.cheng@arm.com>
Thu, 11 May 2017 09:10:01 +0000 (09:10 +0000)
committerBin Cheng <amker@gcc.gnu.org>
Thu, 11 May 2017 09:10:01 +0000 (09:10 +0000)
From-SVN: r247881

gcc/ChangeLog
gcc/rtlanal.c

index 5c3f579..9fe29bd 100644 (file)
@@ -1,3 +1,7 @@
+2017-05-11  Bin Cheng  <bin.cheng@arm.com>
+
+       * rtlanal.c (rtx_cost): Handle TRUNCATE between tieable modes.
+
 2017-05-11  Richard Biener  <rguenther@suse.de>
 
        * passes.c (execute_function_todo): Verify loops if they are
index 321363f..d9f57c3 100644 (file)
@@ -4164,6 +4164,13 @@ rtx_cost (rtx x, machine_mode mode, enum rtx_code outer_code,
        return COSTS_N_INSNS (2 + factor);
       break;
 
+    case TRUNCATE:
+      if (MODES_TIEABLE_P (mode, GET_MODE (XEXP (x, 0))))
+       {
+         total = 0;
+         break;
+       }
+      /* FALLTHRU */
     default:
       if (targetm.rtx_costs (x, mode, outer_code, opno, &total, speed))
        return total;