This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix 14179 - memory-hog
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Giovanni Bajo <giovannibajo at libero dot it>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 20 Sep 2004 09:54:43 +0100
- Subject: Re: [C++ PATCH] Fix 14179 - memory-hog
- Organization: Codesourcery LLC
- References: <002701c49d80$be7945d0$d14e2597@bagio>
Giovanni Bajo wrote:
This patch fixes it, by using a couple of unsigned HOST_WIDE_INTEGER (low+high)
instead. This mimics INTEGER_CSTs but without building trees every time. I
guess we cannot do it with a single HWI for cases like crosscompiling a 32bit
application with arrays with more than 65536 elements on a 16bit host, so this
is why I am using a couple of them (just like INTEGER_CST).
We do not support hosts where int is < 32 bits. A single HOST_WIDE_INTEGER
will suffice.
With a reduced testcases with half million elements, we save approximately
13Mb. On the full testcase, the projected gain is around 200Mb. Together with
Nathan's cache for INTEGER_CSTs, I think this solves the memory-hog on
mainline. I will update the PR with updated measurements when/if this patch
goes in.
One thing more thing that might be worth trying would be to resurrect
the size_int hash table for ints which don't fit in the little type specific
vector.
Bootstrapped on i686-pc-linux-gnu, OK for mainline?
ok with the above change.
OK for 3.4 and 3.3 too? The patch does cure a regression, and it looks pretty
safe to me. The diff looks more complex than it needs because of some
refactoring and extracting the code into a new function -- if needed, I can
prepare a stripped down version with minimal intrusiveness (assuming it's an
English word...).
Please ask Gaby and Mark directly.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk