From b95a64bb005dd197e19df5b67b98a5e5dbdb6f8b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 11 Aug 2016 16:50:09 +0200 Subject: =?UTF-8?q?re=20PR=20c/72816=20(ICE=20on=20x86=5F64-linux-gnu=20(t?= =?UTF-8?q?ree=20check:=20expected=20tree=20that=20contains=20=E2=80=98dec?= =?UTF-8?q?l=20with=20RTL=E2=80=99=20structure,=20have=20=E2=80=98field=5F?= =?UTF-8?q?decl=E2=80=99=20in=20set=5Fdecl=5Frtl,=20at=20emit-rtl.c:1282))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR c/72816 * c-decl.c (grokdeclarator): When adding TYPE_DOMAIN for flexible array member through typedef, for orig_qual_indirect == 0 clear orig_qual_type. * gcc.dg/pr72816.c: New test. From-SVN: r239371 --- gcc/c/c-decl.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gcc/c/c-decl.c') diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 5f38985..9ad473c 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -6710,6 +6710,8 @@ grokdeclarator (const struct c_declarator *declarator, type = build_distinct_type_copy (TYPE_MAIN_VARIANT (type)); TYPE_DOMAIN (type) = build_range_type (sizetype, size_zero_node, NULL_TREE); + if (orig_qual_indirect == 0) + orig_qual_type = NULL_TREE; } type = c_build_qualified_type (type, type_quals, orig_qual_type, orig_qual_indirect); -- cgit v1.1