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]

(C++) patch to mark_addressable


We should always call mark_used when we figure out what function we're
using, before we get to mark_addressable.  Currently we don't do that
for internal calls to library functions, however; perhaps that should
be changed.

2000-07-17  Jason Merrill  <jason@redhat.com>

	* typeck.c (mark_addressable): Never set TREE_USED.
	* call.c (build_call): Don't abort on calls to library functions
	that have been declared normally.

Index: typeck.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/typeck.c,v
retrieving revision 1.297
diff -c -p -r1.297 typeck.c
*** typeck.c	2000/07/10 07:16:23	1.297
--- typeck.c	2000/07/17 21:28:50
*************** mark_addressable (exp)
*** 4969,4989 ****
  	  cp_warning ("address requested for `%D', which is declared `register'",
  		      x);
  	TREE_ADDRESSABLE (x) = 1;
- 	TREE_USED (x) = 1;
  	if (cfun && expanding_p)
  	  put_var_into_stack (x);
  	return 1;
  
        case FUNCTION_DECL:
- 	/* We have to test both conditions here.  The first may be
- 	   non-zero in the case of processing a default function.  The
- 	   second may be non-zero in the case of a template function.  */
- 	if (DECL_LANG_SPECIFIC (x)
- 	    && DECL_TEMPLATE_INFO (x) 
- 	    && !DECL_TEMPLATE_SPECIALIZATION (x))
- 	  mark_used (x);
  	TREE_ADDRESSABLE (x) = 1;
- 	TREE_USED (x) = 1;
  	TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
  	return 1;
  
--- 4969,4980 ----
Index: call.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/call.c,v
retrieving revision 1.227
diff -c -p -r1.227 call.c
*** call.c	2000/07/05 20:04:49	1.227
--- call.c	2000/07/17 21:28:53
*************** build_call (function, parms)
*** 397,404 ****
  
    if (decl && ! TREE_USED (decl))
      {
!       /* We invoke build_call directly for several library functions.  */
!       if (DECL_ARTIFICIAL (decl))
  	mark_used (decl);
        else
  	my_friendly_abort (990125);
--- 397,407 ----
  
    if (decl && ! TREE_USED (decl))
      {
!       /* We invoke build_call directly for several library functions.
! 	 These may have been declared normally if we're building libgcc,
! 	 so we can't just check DECL_ARTIFICIAL.  */
!       if (DECL_ARTIFICIAL (decl)
! 	  || !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "__", 2))
  	mark_used (decl);
        else
  	my_friendly_abort (990125);

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