optabs.c (init_one_libfunc): Gen a FUNCTION_DECL for use by ENCODE_SECTION_INFO...
authorRichard Henderson <rth@redhat.com>
Fri, 21 Sep 2001 20:42:14 +0000 (13:42 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 21 Sep 2001 20:42:14 +0000 (13:42 -0700)
        * optabs.c (init_one_libfunc): Gen a FUNCTION_DECL for use by
        ENCODE_SECTION_INFO; get SYMBOL_REF from make_decl_rtl.

From-SVN: r45737

gcc/ChangeLog
gcc/optabs.c

index 414effb1ef63789c8af999296f907375be18e8d1..69bc75f007fc26a9b280c1af4809a4c879508b8e 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-21  Richard Henderson  <rth@redhat.com>
+
+       * optabs.c (init_one_libfunc): Gen a FUNCTION_DECL for use by
+       ENCODE_SECTION_INFO; get SYMBOL_REF from make_decl_rtl.
+
 2001-09-21  Richard Henderson  <rth@redhat.com>
 
        * rtl.h (LCT_RETURNS_TWICE): New.
index 7957719b4f94730a2aa4c39ebbb1d209e15ecef4..6421adf6ef3d239bb210fa23db29e5ab39edf7ac 100644 (file)
@@ -4687,9 +4687,17 @@ rtx
 init_one_libfunc (name)
      register const char *name;
 {
-  name = ggc_strdup (name);
-
-  return gen_rtx_SYMBOL_REF (Pmode, name);
+  /* Create a FUNCTION_DECL that can be passed to ENCODE_SECTION_INFO.  */
+  /* ??? We don't have any type information except for this is
+     a function.  See if error_mark_node is good enough.  */
+  tree decl = build_decl (FUNCTION_DECL, get_identifier (name),
+                         error_mark_node);
+  DECL_ARTIFICIAL (decl) = 1;
+  DECL_EXTERNAL (decl) = 1;
+  TREE_PUBLIC (decl) = 1;
+
+  /* Return the symbol_ref from the mem rtx.  */
+  return XEXP (DECL_RTL (decl), 0);
 }
 
 /* Mark ARG (which is really an OPTAB *) for GC.  */