[Bug c++/17323] ICE on invalid code if static member array initialized with size computed as division by zero

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Sep 8 07:04:00 GMT 2004


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-08 07:04 -------
hmm, the problem looks like it has nothing to do with sizeof at all but it has to do with DECL_INITIAL 
for x still being an INIT_EXPR so we check the first operand for value_dependent_expression_p but 
since that just links back to x, we go into an infinite loop which causes this ICE (stack overflow).
Maybe we should have cleared out the DECL_INITIAL and put a error_node there instead.


Part of the backtrace (I cannot get all of it because it is just repeating two parts of 
alue_dependent_expression_p)

#40392 0x080eab2d in cp_parser_type_specifier (parser=0xf6e128f0, flags=Variable "flags" is not 
available.
) at /home/gates/pinskia/src/gnu/gcc/src/gcc/cp/parser.c:12809
warning: Source file is more recent than executable.

12809       CLASSTYPE_DECLARED_CLASS (type) = (class_key == class_type);
(gdb) up -1
#40391 0x080776e1 in xref_basetypes (ref=0xf6e14074, base_list=0xf6e13180) at /home/gates/
pinskia/src/gnu/gcc/src/gcc/cp/decl.c:9136
warning: Source file is more recent than executable.


Also gdb just seg faults on me alot when going through all these stack frames (yes I am using the cvs 
version, I should report a bug).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code


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



More information about the Gcc-bugs mailing list