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]
Other format: [Raw text]

tiny speed tweak to check_global_declarations


It turns out that some symbols actually don't have a
DECL_ASSEMBLER_NAME at this point in the compilation; let's keep it
that way, maybe we'll never need to make one at all.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-lessasmname.patch=====================
2004-06-03  Geoffrey Keating  <geoffk@apple.com>

	* toplev.c (check_global_declarations): Don't ask for
	DECL_ASSEMBLER_NAME unless the function really is declared
	static and not defined.

*** toplev.c.~1.898.~	Wed May 26 14:18:56 2004
--- toplev.c	Thu Jun  3 07:00:22 2004
***************
*** 1515,1526 ****
  	 because many programs have static variables
  	 that exist only to get some text into the object file.  */
        if (TREE_CODE (decl) == FUNCTION_DECL
- 	  && (warn_unused_function
- 	      || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
  	  && DECL_INITIAL (decl) == 0
  	  && DECL_EXTERNAL (decl)
  	  && ! DECL_ARTIFICIAL (decl)
! 	  && ! TREE_PUBLIC (decl))
  	{
  	  if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
  	    pedwarn ("%J'%F' used but never defined", decl, decl);
--- 1515,1526 ----
  	 because many programs have static variables
  	 that exist only to get some text into the object file.  */
        if (TREE_CODE (decl) == FUNCTION_DECL
  	  && DECL_INITIAL (decl) == 0
  	  && DECL_EXTERNAL (decl)
  	  && ! DECL_ARTIFICIAL (decl)
! 	  && ! TREE_PUBLIC (decl)
! 	  && (warn_unused_function
! 	      || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
  	{
  	  if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
  	    pedwarn ("%J'%F' used but never defined", decl, decl);
============================================================


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