From: David Malcolm Date: Fri, 16 Aug 2013 14:59:02 +0000 (+0000) Subject: Fix bad interaction between GTY((user)) and incomplete declarations X-Git-Tag: releases/gcc-4.9.0~4552 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=158f4e4f46cab61f09dfce1ff2ac7dbfec8bb615;p=thirdparty%2Fgcc.git Fix bad interaction between GTY((user)) and incomplete declarations gcc/ * gengtype.c (create_user_defined_type): Ensure that the kind is set to TYPE_USER_STRUCT, fixing a bug seen when an incomplete declaration is seen before the GTY((user)) marking. From-SVN: r201791 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cc512075d070..e71ae3edbf74 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-08-16 David Malcolm + + * gengtype.c (create_user_defined_type): Ensure that the kind + is set to TYPE_USER_STRUCT, fixing a bug seen when an incomplete + declaration is seen before the GTY((user)) marking. + 2013-08-16 Bernd Edlinger PR target/58105 diff --git a/gcc/gengtype.c b/gcc/gengtype.c index 20854966facf..9c1275227331 100644 --- a/gcc/gengtype.c +++ b/gcc/gengtype.c @@ -559,6 +559,12 @@ type_p create_user_defined_type (const char *type_name, struct fileloc *pos) { type_p ty = find_structure (type_name, TYPE_USER_STRUCT); + + /* We might have already seen an incomplete decl of the given type, + in which case we won't have yet seen a GTY((user)), and the type will + only have kind "TYPE_STRUCT". Mark it as a user struct. */ + ty->kind = TYPE_USER_STRUCT; + ty->u.s.line = *pos; ty->u.s.bitmap = get_lang_bitmap (pos->file); do_typedef (type_name, ty, pos);