When compiling certain java programs (like libgcj) with freduced-reflection, jc1 will ICE with SIGSEGV. The cause is a small logic error in make_class_data(tree). We allocate a VEC of length zero with VEC_alloc(int, heap, 0) which returns NULL, but then try to add an element with VEC_quick_push() resulting in SIGSEGV as the VEC is NULL. We should only be adding the field indexes if they are static or (uses_jv_markobj || !flag_reduced_reflection), but we unconditionally fall through and always add something. The fix is to continue the loop if the conditions for field inclusion are not met and not add the bogus index. Currently bootstrapping/testing on i686-pc-linux-gnu. OK to commit if it passes? 2008-08-20 David Daney * class.c (make_class_data): Don't add field_index when flag_reduced_reflection set.