i386.c (ix86_rtx_costs): For -fpic and x86-64 local symbolic constants are not expensive.
authorJan Hubicka <jh@suse.cz>
Tue, 25 Mar 2003 19:44:50 +0000 (20:44 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Tue, 25 Mar 2003 19:44:50 +0000 (19:44 +0000)
* i386.c (ix86_rtx_costs): For -fpic and x86-64 local symbolic
constants are not expensive.

From-SVN: r64855

gcc/ChangeLog
gcc/config/i386/i386.c

index ff7624a8ec67f4f174b3686322a76be53e52e69e..7114741559c7665d1ce3fcda977fccee8d76c8cb 100644 (file)
@@ -1,3 +1,8 @@
+Tue Mar 25 20:35:51 CET 2003  Jan Hubicka  <jh@suse.cz>
+
+       * i386.c (ix86_rtx_costs): For -fpic and x86-64 local symbolic
+       constants are not expensive.
+
 Mon Mar 24 20:03:03 CET 2003  Jan Hubicka  <jh@suse.cz>
 
        PR opt/10056
index d640f22aa71722d1f379c0c70988394430b127ee..9c6653cfcfca2caaf7f8e8e83766d32fca4bc168 100644 (file)
@@ -14939,7 +14939,11 @@ ix86_rtx_costs (x, code, outer_code, total)
        *total = 3;
       else if (TARGET_64BIT && !x86_64_zero_extended_value (x))
        *total = 2;
-      else if (flag_pic && SYMBOLIC_CONST (x))
+      else if (flag_pic && SYMBOLIC_CONST (x)
+              && (!TARGET_64BIT
+                  || (!GET_CODE (x) != LABEL_REF
+                      && (GET_CODE (x) != SYMBOL_REF
+                          || !SYMBOL_REF_FLAG (x)))))
        *total = 1;
       else
        *total = 0;
@@ -14962,7 +14966,7 @@ ix86_rtx_costs (x, code, outer_code, total)
            /* Start with (MEM (SYMBOL_REF)), since that's where
               it'll probably end up.  Add a penalty for size.  */
            *total = (COSTS_N_INSNS (1)
-                     + (flag_pic != 0)
+                     + (flag_pic != 0 && !TARGET_64BIT)
                      + (mode == SFmode ? 0 : mode == DFmode ? 1 : 2));
            break;
          }