re PR target/86994 (64-bit gcc.target/i386/20040112-1.c FAILs)
authorUros Bizjak <ubizjak@gmail.com>
Sun, 19 Aug 2018 19:10:37 +0000 (21:10 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 19 Aug 2018 19:10:37 +0000 (21:10 +0200)
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
gcc/config/i386/i386.c

index ccc76e4..ec1fb24 100644 (file)
@@ -1,3 +1,12 @@
+2018-08-19  Uros Bizjak  <ubizjak@gmail.com>
+
+       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  <iain@sandoe.co.uk>
 
        * config/darwin.c (darwin_override_options): If -gsplit-dwarf is set,
index 3548de2..0b2b1b7 100644 (file)
@@ -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: