This is the mail archive of the gcc@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]
Other format: [Raw text]

Don't generate a new SYMBOL_REF in write_resource_constructor


This fixes a bug in write_resource_constructor.

At present we create a new SYMBOL_REF when passing a resource to
registerResource_libfunc, rather than using the SYMBOL_REF that is
already in the DECL_RTL of the resource.  

This doesn't usually matter, but on some systems the DECL_RTL has
flags that we need, and of course we lose these flags if we create a
new SYMBOL_REF from the DECL_NAME.  For example, on some systems there
is a SYMBOL_REF_FLAG that is used to indicate a symbol that may be
accessed as an offset from the GOT.

Andrew.


	* resource.c (write_resource_constructor): Pass the DECL_RTL of a
	resource to registerResource_libfunc rather than constructing a
	new SYMBOL_REF.

Index: resource.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/resource.c,v
retrieving revision 1.2
diff -p -2 -c -r1.2 resource.c
*** resource.c	23 Jan 2003 02:38:57 -0000	1.2
--- resource.c	27 Mar 2003 18:51:37 -0000
*************** write_resource_constructor (void)
*** 132,138 ****
         iter = TREE_CHAIN (iter))
      {
-       const char *name = IDENTIFIER_POINTER (DECL_NAME (TREE_VALUE (iter)));
        emit_library_call (registerResource_libfunc, 0, VOIDmode, 1,
! 			 gen_rtx (SYMBOL_REF, Pmode, name),
  			 Pmode);
      }
--- 132,137 ----
         iter = TREE_CHAIN (iter))
      {
        emit_library_call (registerResource_libfunc, 0, VOIDmode, 1,
! 			 XEXP (DECL_RTL (TREE_VALUE (iter)), 0),
  			 Pmode);
      }


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