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] Drop after_inlining check in remove_unused_locals


This removes the after_inlining check in remove_unused_locals.  This
way we can avoid copying them during the inlining phases and save
some memory (about 4% for tramp3d).

The reasoning is simple, absolute UID differences may not matter
for code-generation, only the ordering of decls with respect to
their UID has to be stable across compilations (so this also
removes the need for the fancy UID namespace of DEBUG_EXPR_DECLs,
they could just use the regular UID namespace).

The after_inlining flag is now only used in an assert - I decided
to still leave it in.  Honza, any different opinion here?

Bootstrapped and tested on x86_64-unknown-linux-gnu, bootstrapped
with -O3 and -Os, bootstrapped with bootstrap-debug-lib as well,
all languages including Ada and obj-c++.

I will install this tomorrow, I have installed the prerequesites
already.

Thanks,
Richard.

2009-11-30  Richard Guenther  <rguenther@suse.de>

	* final.c (rest_of_clean_state): If -fcompare-debug is
	given dump final insns without UIDs.
	* tree-ssa-live.c (remove_unused_scope_block_p): Remove
	after_inlining checks.

Index: gcc/final.c
===================================================================
*** gcc/final.c.orig	2009-11-29 16:14:21.000000000 +0100
--- gcc/final.c	2009-11-29 16:19:50.000000000 +0100
*************** rest_of_clean_state (void)
*** 4382,4387 ****
--- 4382,4389 ----
  	     : "");
  
  	  flag_dump_noaddr = flag_dump_unnumbered = 1;
+ 	  if (flag_compare_debug_opt || flag_compare_debug)
+ 	    dump_flags |= TDF_NOUID;
  
  	  for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
  	    if (LABEL_P (insn))
Index: gcc/tree-ssa-live.c
===================================================================
*** gcc/tree-ssa-live.c.orig	2009-11-29 16:14:21.000000000 +0100
--- gcc/tree-ssa-live.c	2009-11-29 16:19:50.000000000 +0100
*************** remove_unused_scope_block_p (tree scope)
*** 475,485 ****
  	 type is used or not.  */
  
        else if (debug_info_level == DINFO_LEVEL_NORMAL
! 	       || debug_info_level == DINFO_LEVEL_VERBOSE
! 	       /* Removing declarations before inlining is going to affect
! 		  DECL_UID that in turn is going to affect hashtables and
! 		  code generation.  */
! 	       || !cfun->after_inlining)
  	;
        else
  	{
--- 475,481 ----
  	 type is used or not.  */
  
        else if (debug_info_level == DINFO_LEVEL_NORMAL
! 	       || debug_info_level == DINFO_LEVEL_VERBOSE)
  	;
        else
  	{
*************** remove_unused_scope_block_p (tree scope)
*** 527,538 ****
        eliminated.  */
     else if (!nsubblocks)
       ;
-    /* If there are live subblocks and we still have some unused variables
-       or types declared, we must keep them.
-       Before inliing we must not depend on debug info verbosity to keep
-       DECL_UIDs stable.  */
-    else if (!cfun->after_inlining && BLOCK_VARS (scope))
-      unused = false;
     /* For terse debug info we can eliminate info on unused variables.  */
     else if (debug_info_level == DINFO_LEVEL_NONE
  	    || debug_info_level == DINFO_LEVEL_TERSE)
--- 523,528 ----


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