[Bug middle-end/18191] [4.0 Regression] Struct member is not getting default-initialized

steven at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Dec 16 07:56:00 GMT 2004


------- Additional Comments From steven at gcc dot gnu dot org  2004-12-16 07:56 -------
The new4.C failure happens because we trip over an assert: 
 
#1  0x0000000000629120 in gimplify_init_ctor_eval (object=0x2a95999bc0, 
list=0x2a9599bf00, 
    pre_p=0x7fbfffca08, cleared=0 '\0') at gimplify.c:2404 
2404              gcc_assert (TREE_CODE (purpose) != RANGE_EXPR); 
 
the test case is this: 
int *x = new int [2] (); 
 
For some reason the constructor has three (!) elements instead of two, 
which probably causes this bug to be hidden in the existing code. 
 
The other two are also cases where the "cleared" flag used to be set when 
it really shouldn't have been, so that's another latent but that my patch 
uncovers :-( 
 

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18191



More information about the Gcc-bugs mailing list