From a5cac223dff2f83b83318ecf4dedc98a98649e2a Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 7 May 2020 14:00:18 -0400 Subject: [PATCH] Fix bogus calls to set_rtx_cost. * 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 | 6 ++++++ gcc/tree-ssa-reassoc.c | 5 +++-- gcc/tree-switch-conversion.c | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 986da64ff8d..0a30ea3a184 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2020-05-07 Alan Modra + + * 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 * tree-vect-stmts.c (vectorizable_load): Check alignment to avoid diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index ec1c033a2cf..af8faf2e6ea 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -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); diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index bf910dd62b5..4b435941d12 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -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); -- 2.30.2