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]

[PATCH] speedup make_decl_rtl for real


When I was trying to speedup the building of libjava, I had misread
what had been passed to decode_reg_name so I had thought that checking
for zero length strings would speed it up but it did not as what is
passed is actually the assembler name of the decl.
This patch reverts the previous patch and changes make_decl_rtl so we
don't call decode_reg_name when we do not need to which speeds
up compiling libjava and most likely also C++ code too but I did not
measure it.

OK? Bootstrapped on powerpc-apple-darwin with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

	* varasm.c (decode_reg_name): Revert change to check for zero
	length strings.
	(make_decl_rtl): Make sure that we call decode_reg_name only
	when needed.

Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.445
diff -u -p -r1.445 varasm.c
--- varasm.c	19 Aug 2004 06:16:37 -0000	1.445
+++ varasm.c	27 Aug 2004 04:47:11 -0000
@@ -779,7 +779,7 @@ set_user_assembler_name (tree decl, cons
 int
 decode_reg_name (const char *asmspec)
 {
-  if (asmspec != 0 && strlen (asmspec) != 0)
+  if (asmspec != 0)
     {
       int i;

@@ -889,7 +889,11 @@ make_decl_rtl (tree decl)

name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));

-  reg_number = decode_reg_name (name);
+  if ((TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
+      || name[0] == '*')
+    reg_number = decode_reg_name (name);
+  else
+    reg_number = -1;

   if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
     {


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