Trim down memory usage in alias.c
Andreas Jaeger
aj@suse.de
Tue Jan 20 20:59:00 GMT 2004
Jan Hubicka <jh@suse.cz> writes:
> Hi,
> this trick reduces amount of memory allocated by that ggc_alloc call
> from 31MB to 800Kb for Gerald's testcase and 256MB system.
>
> Fulltesting is still in progress (I've killed it by accident), OK if it
> passes?
>
> Honza
>
> * alias.c (old_reg_base_value, old_reg_base_value_size): New global variables.
> (init_alias_analysis): Reuse existing array if available.
>
> Index: alias.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/alias.c,v
> retrieving revision 1.210
> diff -c -3 -p -r1.210 alias.c
> *** alias.c 17 Jan 2004 09:31:29 -0000 1.210
> --- alias.c 20 Jan 2004 20:32:36 -0000
> *************** static GTY((length ("reg_base_value_size
> *** 161,166 ****
> --- 161,172 ----
> static rtx *new_reg_base_value;
> static unsigned int reg_base_value_size; /* size of reg_base_value array */
>
> + /* We preserve the copy of old array around to avoid amount of garbage
> + produced. About 8% of garbage produced were attributed to this
> + array. */
> + static GTY((deletable (""))) rtx *old_reg_base_value;
> + static unsigned int old_reg_base_value_size;
Should we really use int? I thought that size_t would be more
appropriate or is this not possible to do?
Andreas
--
Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
SuSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
GPG fingerprint = 93A3 365E CE47 B889 DF7F FED1 389A 563C C272 A126
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040120/3d3cb2eb/attachment.sig>
More information about the Gcc-patches
mailing list