From c6067437d314f803a6b7c1083f6d280caaf17ce3 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Sun, 19 Aug 2018 21:10:37 +0200 Subject: [PATCH] re PR target/86994 (64-bit gcc.target/i386/20040112-1.c FAILs) PR target/86994 * config/i386/i386.c (ix86_rtx_costs) [case SET]: Check source for register_operand when calling ix86_set_reg_reg_cost. [case CONST_INT, case CONST, case LABEL_REF, case SYMBOL_REF]: Set *total to 0 for operands that satisfy x86_64_immediate_operand predicate and to 1 otherwise. From-SVN: r263652 --- gcc/ChangeLog | 9 +++++++++ gcc/config/i386/i386.c | 18 ++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ccc76e48bb0..ec1fb242c23 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2018-08-19 Uros Bizjak + + PR target/86994 + * config/i386/i386.c (ix86_rtx_costs) [case SET]: Check source for + register_operand when calling ix86_set_reg_reg_cost. + [case CONST_INT, case CONST, case LABEL_REF, case SYMBOL_REF]: + Set *total to 0 for operands that satisfy x86_64_immediate_operand + predicate and to 1 otherwise. + 2018-08-18 Iain Sandoe * config/darwin.c (darwin_override_options): If -gsplit-dwarf is set, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3548de2169c..0b2b1b796d6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -40554,7 +40554,7 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno, { case SET: if (register_operand (SET_DEST (x), VOIDmode) - && reg_or_0_operand (SET_SRC (x), VOIDmode)) + && register_operand (SET_SRC (x), VOIDmode)) { *total = ix86_set_reg_reg_cost (GET_MODE (SET_DEST (x))); return true; @@ -40581,20 +40581,10 @@ ix86_rtx_costs (rtx x, machine_mode mode, int outer_code_i, int opno, case CONST: case LABEL_REF: case SYMBOL_REF: - if (TARGET_64BIT && !x86_64_immediate_operand (x, VOIDmode)) - *total = 3; - else if (TARGET_64BIT && !x86_64_zext_immediate_operand (x, VOIDmode)) - *total = 2; - else if (flag_pic && SYMBOLIC_CONST (x) - && !(TARGET_64BIT - && (GET_CODE (x) == LABEL_REF - || (GET_CODE (x) == SYMBOL_REF - && SYMBOL_REF_LOCAL_P (x)))) - /* Use 0 cost for CONST to improve its propagation. */ - && (TARGET_64BIT || GET_CODE (x) != CONST)) - *total = 1; - else + if (x86_64_immediate_operand (x, VOIDmode)) *total = 0; + else + *total = 1; return true; case CONST_DOUBLE: -- 2.30.2