Commit 152ef731 by Jakub Jelinek

re PR c/71685 (Segmentation fault in gcc when compiling the attached file.)

	PR c/71685
	* c-typeck.c (c_build_qualified_type): Don't clear
	C_TYPE_INCOMPLETE_VARS for the main variant.

	* gcc.dg/pr71685.c: New test.

From-SVN: r237830
parent 4378d117
2016-06-29 Jakub Jelinek <jakub@redhat.com>
PR c/71685
* c-typeck.c (c_build_qualified_type): Don't clear
C_TYPE_INCOMPLETE_VARS for the main variant.
2016-06-28 Martin Sebor <msebor@redhat.com>
PR c/71552
......
......@@ -13676,7 +13676,8 @@ c_build_qualified_type (tree type, int type_quals, tree orig_qual_type,
: build_qualified_type (type, type_quals));
/* A variant type does not inherit the list of incomplete vars from the
type main variant. */
if (RECORD_OR_UNION_TYPE_P (var_type))
if (RECORD_OR_UNION_TYPE_P (var_type)
&& TYPE_MAIN_VARIANT (var_type) != var_type)
C_TYPE_INCOMPLETE_VARS (var_type) = 0;
return var_type;
}
......
2016-06-29 Jakub Jelinek <jakub@redhat.com>
PR c/71685
* gcc.dg/pr71685.c: New test.
2016-06-28 Martin Sebor <msebor@redhat.com>
PR c/71552
......
/* PR c/71685 */
/* { dg-do compile } */
/* { dg-options "-std=gnu11" } */
extern struct S v, s;
struct S { int t; int p[]; } v = { 4, 0 };
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