This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14179] [3.3/3.4/4.0 Regression] out of memory


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]