[backport from gcc-4.7/trunk r181172, one hunk only, fixes PR51969 ] gcc/ 2011-11-08 Michael Matz * gengtype.c (write_field_root): Avoid out-of-scope access of newv. --- gcc-4.6.2/gcc/gengtype.c.~1~ 2010-11-25 20:03:27.000000000 +0100 +++ gcc-4.6.2/gcc/gengtype.c 2012-02-05 22:28:03.000000000 +0100 @@ -3594,14 +3594,13 @@ write_field_root (outf_p f, pair_p v, ty int has_length, struct fileloc *line, const char *if_marked, bool emit_pch, type_p field_type, const char *field_name) { + struct pair newv; /* If the field reference is relative to V, rather than to some subcomponent of V, we can mark any subarrays with a single stride. We're effectively treating the field as a global variable in its own right. */ if (v && type == v->type) { - struct pair newv; - newv = *v; newv.type = field_type; newv.name = ACONCAT ((v->name, ".", field_name, NULL));