]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
s390.c (s390_mark_symbol_ref_as_used): New function.
authorJakub Jelinek <jakub@redhat.com>
Thu, 30 Oct 2008 22:36:30 +0000 (23:36 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 30 Oct 2008 22:36:30 +0000 (23:36 +0100)
* config/s390/s390.c (s390_mark_symbol_ref_as_used): New function.
(s390_output_pool_entry): Call it through for_each_rtx.

From-SVN: r141468

gcc/ChangeLog
gcc/config/s390/s390.c

index b7b85230ae3542fc3a19993dd4a7964c5de5c11d..0ae09105ca70239bf967c39e0995061199c7faa8 100644 (file)
@@ -1,5 +1,8 @@
 2008-10-30  Jakub Jelinek  <jakub@redhat.com>
 
+       * config/s390/s390.c (s390_mark_symbol_ref_as_used): New function.
+       (s390_output_pool_entry): Call it through for_each_rtx.
+
        PR middle-end/37730
        * expr.c (store_constructor): For vectors, if target is a MEM, use
        target's MEM_ALIAS_SET instead of elttype alias set.
index 45dae8bb20db2af20162ed9091830db0283137f2..e64b58ca9040d53a5586640bb165d7f2509df7fb 100644 (file)
@@ -6664,6 +6664,24 @@ s390_chunkify_cancel (struct constant_pool *pool_list)
     }
 }
 
+/* Helper rtx-iteration-function for s390_output_pool_entry.  Marks
+   SYMBOL_REFs as referenced through use of assemble_external.  */
+
+static int
+s390_mark_symbol_ref_as_used (rtx *x, void *dummy ATTRIBUTE_UNUSED)
+{
+  /* If we have a used symbol, we may have to emit assembly
+     annotations corresponding to whether the symbol is external, weak
+     or has non-default visibility.  */
+  if (GET_CODE (*x) == SYMBOL_REF)
+    {
+      tree t = SYMBOL_REF_DECL (*x);
+      if (t)
+        assemble_external (t);
+      return -1;
+    }
+  return 0;
+}
 
 /* Output the constant pool entry EXP in mode MODE with alignment ALIGN.  */
 
@@ -6684,6 +6702,7 @@ s390_output_pool_entry (rtx exp, enum machine_mode mode, unsigned int align)
 
     case MODE_INT:
       assemble_integer (exp, GET_MODE_SIZE (mode), align, 1);
+      for_each_rtx (&exp, s390_mark_symbol_ref_as_used, NULL);
       break;
 
     default: