cris.c (cris_gotless_symbol, [...]): Use SYMBOL_REF_LOCAL_P; abort if not pic.
authorRichard Henderson <rth@redhat.com>
Thu, 17 Apr 2003 05:53:21 +0000 (22:53 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 17 Apr 2003 05:53:21 +0000 (22:53 -0700)
        * config/cris/cris.c (cris_gotless_symbol, cris_got_symbol): Use
        SYMBOL_REF_LOCAL_P; abort if not pic.
        (cris_encode_section_info): Remove.

From-SVN: r65721

gcc/ChangeLog
gcc/config/cris/cris.c

index c4b97224308c2b23636e7a95cd47fc513c2f3f7d..5e859e6f3f9e9300a9917f842b6fdd702e8107ad 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-16  Richard Henderson  <rth@redhat.com>
+
+       * config/cris/cris.c (cris_gotless_symbol, cris_got_symbol): Use
+       SYMBOL_REF_LOCAL_P; abort if not pic.
+       (cris_encode_section_info): Remove.
+
 2003-04-16  Richard Henderson  <rth@redhat.com>
 
        * config/c4x/c4x.c (c4x_encode_section_info): Remove.
index ed3bc9eacbc3778213f91f3f80cd0931124a8076..dfd3464a492c35dba289b05562b4b92dae6073c9 100644 (file)
@@ -100,7 +100,6 @@ static void cris_target_asm_function_prologue
 static void cris_target_asm_function_epilogue
   PARAMS ((FILE *, HOST_WIDE_INT));
 
-static void cris_encode_section_info PARAMS ((tree, int));
 static void cris_operand_lossage PARAMS ((const char *, rtx));
 
 static void cris_asm_output_mi_thunk
@@ -158,9 +157,6 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
 #undef TARGET_ASM_FUNCTION_EPILOGUE
 #define TARGET_ASM_FUNCTION_EPILOGUE cris_target_asm_function_epilogue
 
-#undef TARGET_ENCODE_SECTION_INFO
-#define TARGET_ENCODE_SECTION_INFO cris_encode_section_info
-
 #undef TARGET_ASM_OUTPUT_MI_THUNK
 #define TARGET_ASM_OUTPUT_MI_THUNK cris_asm_output_mi_thunk
 #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -2506,6 +2502,11 @@ int
 cris_gotless_symbol (x)
      rtx x;
 {
+#ifdef ENABLE_CHECKING
+  if (!flag_pic)
+    abort ();
+#endif
+
   switch (GET_CODE (x))
     {
     case UNSPEC:
@@ -2513,9 +2514,9 @@ cris_gotless_symbol (x)
       return 1;
 
     case SYMBOL_REF:
-      if (flag_pic && cfun != NULL)
+      if (cfun != NULL)
        current_function_uses_pic_offset_table = 1;
-      return SYMBOL_REF_FLAG (x);
+      return SYMBOL_REF_LOCAL_P (x);
 
     case LABEL_REF:
       /* We don't set current_function_uses_pic_offset_table for
@@ -2562,6 +2563,11 @@ int
 cris_got_symbol (x)
      rtx x;
 {
+#ifdef ENABLE_CHECKING
+  if (!flag_pic)
+    abort ();
+#endif
+
   switch (GET_CODE (x))
     {
     case UNSPEC:
@@ -2569,9 +2575,9 @@ cris_got_symbol (x)
       return 0;
 
     case SYMBOL_REF:
-      if (flag_pic && cfun != NULL)
+      if (cfun != NULL)
        current_function_uses_pic_offset_table = 1;
-      return ! SYMBOL_REF_FLAG (x);
+      return ! SYMBOL_REF_LOCAL_P (x);
 
     case CONST:
       return cris_got_symbol (XEXP (x, 0));
@@ -3187,24 +3193,6 @@ restart:
     }
 }
 
-/* Code-in whether we can get away without a GOT entry (needed for
-   externally visible objects but not for functions) into
-   SYMBOL_REF_FLAG and add the PLT suffix for global functions.  */
-
-static void
-cris_encode_section_info (exp, first)
-     tree exp;
-     int first ATTRIBUTE_UNUSED;
-{
-  if (flag_pic)
-    {
-      rtx rtl = DECL_P (exp) ? DECL_RTL (exp) : TREE_CST_RTL (exp);
-
-      if (GET_CODE (rtl) == MEM && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF)
-       SYMBOL_REF_FLAG (XEXP (rtl, 0)) = (*targetm.binds_local_p) (exp);
-    }
-}
-
 #if 0
 /* Various small functions to replace macros.  Only called from a
    debugger.  They might collide with gcc functions or system functions,