[PATCH] Reduce garbage produced by tree-ssa-structalias.c (fwd)

Richard Guenther rguenther@suse.de
Wed Jun 14 10:26:00 GMT 2006


(spam? wtf!)

---------- Forwarded message ----------
Date: Wed, 14 Jun 2006 11:49:41 +0200 (CEST)
From: Richard Guenther <rguenther@suse.de>
To:  <gcc-patches@gcc.gnu.org>
Cc: Daniel Berlin <dberlin@dberlin.org>
Subject: [PATCH] Reduce garbage produced by tree-ssa-structalias.c


This patch reduces the amount of garbage tree-ssa-structalias.c creates
(needlessly, if not dumping) by simply not creating it if dumping is
not in effect.

This saves 5.5% off the peak memory usage compiling tramp3d-v4 with
-O --param ggc-min-expand=50 --param ggc-min-heapsize=32000.

Bootstrapped and tested on x86_64-unknown-linux-gnu.

Ok for mainline?

Thanks,
Richard.

:ADDPATCH alias:

2006-06-14  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-structalias.c (alias_get_name): Avoid creating
	extra unused identifiers if not dumping.
	(create_variable_info_for): Likewise.

Index: tree-ssa-structalias.c
===================================================================
*** tree-ssa-structalias.c	(revision 114599)
--- tree-ssa-structalias.c	(working copy)
*************** alias_get_name (tree decl)
*** 2167,2172 ****
--- 2167,2175 ----
      return res;
  
    res = "NULL";
+   if (!dump_file)
+     return res;
+ 
    if (TREE_CODE (decl) == SSA_NAME)
      {
        num_printed = asprintf (&temp, "%s_%u", 
*************** create_variable_info_for (tree decl, con
*** 3987,4002 ****
  	   i--)
  	{
  	  varinfo_t newvi;
! 	  const char *newname;
  	  char *tempname;
  
  	  newindex = VEC_length (varinfo_t, varmap);
! 	  if (fo->decl)
! 	    asprintf (&tempname, "%s.%s", vi->name, alias_get_name (fo->decl));
! 	  else
! 	    asprintf (&tempname, "%s." HOST_WIDE_INT_PRINT_DEC, vi->name, fo->offset);
! 	  newname = ggc_strdup (tempname);
! 	  free (tempname);
  	  newvi = new_var_info (decl, newindex, newname, newindex);
  	  newvi->offset = fo->offset;
  	  newvi->size = TREE_INT_CST_LOW (fo->size);
--- 3990,4010 ----
  	   i--)
  	{
  	  varinfo_t newvi;
! 	  const char *newname = "NULL";
  	  char *tempname;
  
  	  newindex = VEC_length (varinfo_t, varmap);
! 	  if (dump_file)
! 	    {
! 	      if (fo->decl)
! 	        asprintf (&tempname, "%s.%s",
! 			  vi->name, alias_get_name (fo->decl));
! 	      else
! 	        asprintf (&tempname, "%s." HOST_WIDE_INT_PRINT_DEC,
! 			  vi->name, fo->offset);
! 	      newname = ggc_strdup (tempname);
! 	      free (tempname);
! 	    }
  	  newvi = new_var_info (decl, newindex, newname, newindex);
  	  newvi->offset = fo->offset;
  	  newvi->size = TREE_INT_CST_LOW (fo->size);



More information about the Gcc-patches mailing list