aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@redhat.com>2016-11-24 12:16:47 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2016-11-24 12:16:47 +0000
commit7998af1f4bf876f7ccf10ce956859e3dc2183774 (patch)
tree952d443daca7ea277e7ca3879914717f0d526990 /gcc
parent21aaaf1e050fac4eb5edd66489cc5c6f1b332b75 (diff)
downloadgcc-7998af1f4bf876f7ccf10ce956859e3dc2183774.zip
gcc-7998af1f4bf876f7ccf10ce956859e3dc2183774.tar.gz
gcc-7998af1f4bf876f7ccf10ce956859e3dc2183774.tar.bz2
re PR rtl-optimization/78120 (If conversion no longer performed)
PR rtl-optimization/78120 * config/i386/i386.c (ix86_rtx_costs): Fully handle SETs. From-SVN: r242832
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.c19
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a22234..8d9de43 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-11-24 Bernd Schmidt <bschmidt@redhat.com>
+
+ PR rtl-optimization/78120
+ * config/i386/i386.c (ix86_rtx_costs): Fully handle SETs.
+
2016-11-24 Bin Cheng <bin.cheng@arm.com>
* match.pd: Refine type conversion in result expr for below pattern:
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3ccee08..0e8dda9 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -40293,6 +40293,7 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno,
enum rtx_code code = GET_CODE (x);
enum rtx_code outer_code = (enum rtx_code) outer_code_i;
const struct processor_costs *cost = speed ? ix86_cost : &ix86_size_cost;
+ int src_cost;
switch (code)
{
@@ -40303,7 +40304,23 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno,
*total = ix86_set_reg_reg_cost (GET_MODE (SET_DEST (x)));
return true;
}
- return false;
+
+ if (register_operand (SET_SRC (x), VOIDmode))
+ /* Avoid potentially incorrect high cost from rtx_costs
+ for non-tieable SUBREGs. */
+ src_cost = 0;
+ else
+ {
+ src_cost = rtx_cost (SET_SRC (x), mode, SET, 1, speed);
+
+ if (CONSTANT_P (SET_SRC (x)))
+ /* Constant costs assume a base value of COSTS_N_INSNS (1) and add
+ a small value, possibly zero for cheap constants. */
+ src_cost += COSTS_N_INSNS (1);
+ }
+
+ *total = src_cost + rtx_cost (SET_DEST (x), mode, SET, 0, speed);
+ return true;
case CONST_INT:
case CONST: