Commit 158f4e4f by David Malcolm Committed by David Malcolm

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
parent 22f8cea5
2013-08-16 David Malcolm <dmalcolm@redhat.com>
* 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 <bernd.edlinger@hotmail.de> 2013-08-16 Bernd Edlinger <bernd.edlinger@hotmail.de>
PR target/58105 PR target/58105
......
...@@ -559,6 +559,12 @@ type_p ...@@ -559,6 +559,12 @@ type_p
create_user_defined_type (const char *type_name, struct fileloc *pos) create_user_defined_type (const char *type_name, struct fileloc *pos)
{ {
type_p ty = find_structure (type_name, TYPE_USER_STRUCT); 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.line = *pos;
ty->u.s.bitmap = get_lang_bitmap (pos->file); ty->u.s.bitmap = get_lang_bitmap (pos->file);
do_typedef (type_name, ty, pos); do_typedef (type_name, ty, pos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment