Fix bogus calls to set_rtx_cost.
authorAlan Modra <amodra@gmail.com>
Thu, 7 May 2020 18:00:18 +0000 (14:00 -0400)
committerJeff Law <law@torsion.usersys.redhat.com>
Thu, 7 May 2020 18:00:18 +0000 (14:00 -0400)
* tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Replace
set_rtx_cost with set_src_cost.
* tree-switch-conversion.c (bit_test_cluster::emit): Likewise.

gcc/ChangeLog
gcc/tree-ssa-reassoc.c
gcc/tree-switch-conversion.c

index 986da64ff8d289e547f643b3ccbacce7eeb04608..0a30ea3a1849aea4f3cfdd05c263ec38a8cdf02e 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-07  Alan Modra  <amodra@gmail.com>
+
+       * tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Replace
+       set_rtx_cost with set_src_cost.
+       * tree-switch-conversion.c (bit_test_cluster::emit): Likewise.
+
 2020-05-07  Kewen Lin  <linkw@gcc.gnu.org>
 
        * tree-vect-stmts.c (vectorizable_load): Check alignment to avoid
index ec1c033a2cff990a6a4a67f74dfc2147e8eafecb..af8faf2e6ea300e28280b2620ce27a47dd0f7d74 100644 (file)
@@ -3208,8 +3208,9 @@ optimize_range_tests_to_bit_test (enum tree_code opcode, int first, int length,
              HOST_WIDE_INT m = tree_to_uhwi (lowi);
              rtx reg = gen_raw_REG (word_mode, 10000);
              bool speed_p = optimize_bb_for_speed_p (gimple_bb (stmt));
-             cost_diff = set_rtx_cost (gen_rtx_PLUS (word_mode, reg,
-                                                     GEN_INT (-m)), speed_p);
+             cost_diff = set_src_cost (gen_rtx_PLUS (word_mode, reg,
+                                                     GEN_INT (-m)),
+                                       word_mode, speed_p);
              rtx r = immed_wide_int_const (mask, word_mode);
              cost_diff += set_src_cost (gen_rtx_AND (word_mode, reg, r),
                                         word_mode, speed_p);
index bf910dd62b538cba2984d031e061b9499470c602..4b435941d127cfbca0965661cd9063d2850f2e9a 100644 (file)
@@ -1541,8 +1541,9 @@ bit_test_cluster::emit (tree index_expr, tree index_type,
       HOST_WIDE_INT m = tree_to_uhwi (minval);
       rtx reg = gen_raw_REG (word_mode, 10000);
       bool speed_p = optimize_insn_for_speed_p ();
-      cost_diff = set_rtx_cost (gen_rtx_PLUS (word_mode, reg,
-                                             GEN_INT (-m)), speed_p);
+      cost_diff = set_src_cost (gen_rtx_PLUS (word_mode, reg,
+                                             GEN_INT (-m)),
+                               word_mode, speed_p);
       for (i = 0; i < count; i++)
        {
          rtx r = immed_wide_int_const (test[i].mask, word_mode);