From b95a64bb005dd197e19df5b67b98a5e5dbdb6f8b Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 11 Aug 2016 16:50:09 +0200 Subject: [PATCH] =?utf8?q?re=20PR=20c/72816=20(ICE=20on=20x86=5F64-linux-g?= =?utf8?q?nu=20(tree=20check:=20expected=20tree=20that=20contains=20?= =?utf8?q?=E2=80=98decl=20with=20RTL=E2=80=99=20structure,=20have=20?= =?utf8?q?=E2=80=98field=5Fdecl=E2=80=99=20in=20set=5Fdecl=5Frtl,=20at=20e?= =?utf8?q?mit-rtl.c:1282))?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 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/ChangeLog | 7 +++++++ gcc/c/c-decl.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr72816.c | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 3161dcb6a02..94f78438043 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,10 @@ +2016-08-11 Jakub Jelinek + + 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. + 2016-08-08 David Malcolm PR c/64955 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 5f38985086c..9ad473cdbcb 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5dde7f145be..944c18dffe0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-08-11 Jakub Jelinek + + PR c/72816 + * gcc.dg/pr72816.c: New test. + 2016-08-11 Bernd Edlinger PR tree-optimization/71083 diff --git a/gcc/testsuite/gcc.dg/pr72816.c b/gcc/testsuite/gcc.dg/pr72816.c index 75b8ba182ad..b1498c7a703 100644 --- a/gcc/testsuite/gcc.dg/pr72816.c +++ b/gcc/testsuite/gcc.dg/pr72816.c @@ -5,5 +5,5 @@ typedef const int A[]; struct S { int a; - A b; /* { dg-error "array size missing" } */ + A b; }; -- 2.30.2