[Bug c++/14179] [3.3/3.4/4.0 Regression] out of memory
giovannibajo at libero dot it
gcc-bugzilla@gcc.gnu.org
Fri Sep 17 18:50:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list