From: Jakub Jelinek Date: Thu, 11 Aug 2016 14:50:09 +0000 (+0200) Subject: re PR c/72816 (ICE on x86_64-linux-gnu (tree check: expected tree that contains ... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b95a64bb005dd197e19df5b67b98a5e5dbdb6f8b;p=gcc.git re PR c/72816 (ICE on x86_64-linux-gnu (tree check: expected tree that contains ‘decl with RTL’ structure, have ‘field_decl’ in set_decl_rtl, at emit-rtl.c:1282)) 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 --- 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; };