This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

init_one_libfunc vs encode_section_info


Ideally we should get rid of libfuncs entirely.  They don't carry
enough type and locus information for a number of platforms.  One
of which is Stormy16, which needs to know the difference between
data symbols and function symbols when emitting pointers, since
we have to use different relocations.

The following is enough to get past the libfunc usage in C++ EH.


r~


	* optabs.c (init_one_libfunc): Gen a FUNCTION_DECL for use by
	ENCODE_SECTION_INFO; get SYMBOL_REF from make_decl_rtl.

Index: optabs.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gcc/optabs.c,v
retrieving revision 1.149
diff -c -p -d -r1.149 optabs.c
*** optabs.c	2001/09/13 13:15:59	1.149
--- optabs.c	2001/09/21 20:33:39
*************** rtx
*** 4687,4695 ****
  init_one_libfunc (name)
       register const char *name;
  {
!   name = ggc_strdup (name);
  
!   return gen_rtx_SYMBOL_REF (Pmode, name);
  }
  
  /* Mark ARG (which is really an OPTAB *) for GC.  */
--- 4687,4703 ----
  init_one_libfunc (name)
       register const char *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.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]