This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14179] [3.3/3.4/4.0 Regression] out of memory
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Sep 2004 18:50:27 -0000
- Subject: [Bug c++/14179] [3.3/3.4/4.0 Regression] out of memory
- References: <20040217171044.14179.debora.j.estey@lmco.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-09-17 18:50 -------
It looks like we do not destroy and recreate initializers in reshape_init,
elements are moved from the old CONSTRUCTOR to the new one.
Instead, while investigating the code, I noticed this in reshape_init:
/* Loop through the array elements, gathering initializers. */
for (index = size_zero_node;
*initp && (!max_index || !tree_int_cst_lt (max_index, index));
index = size_binop (PLUS_EXPR, index, size_one_node))
{
We are constructing a *different* INTEGER_CST for each index, and we never use
it. This generates a lot of garbage.
I do not know if it is enough to switch to HOST_WIDE_INT only, we may want to
handle arrays larger than HWI (e.g. crosscompiling from 16bit to 32bit). My
solution for mainline is to use HWI whenever possible, and falling back to
trees when the indices get too high. Mark, does this make sense?
Dunno if this will be acceptable for 3.3 and 3.4 too, but let's have this fixed
in mainline, as a start.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |giovannibajo at libero dot
|dot org |it
Status|NEW |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14179