From: Jan Hubicka Date: Sun, 29 Nov 2015 19:50:04 +0000 (+0100) Subject: re PR c/67106 (ICE: verify_type failed: type variant differs by TYPE_PACKED. with... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a4850ce9b58d12158248dc7fbe1015646757c813;p=gcc.git re PR c/67106 (ICE: verify_type failed: type variant differs by TYPE_PACKED. with -g -fpack-struct) PR c/67106 * gcc.c-torture/compile/pr67106.c: New testcase. * c-decl.c: Set TYPE_PACKED in variants. From-SVN: r231049 --- diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index ffa365c1f72..0655aef6c19 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2015-11-29 Jan Hubicka + + PR c/67106 + * c-decl.c: Set TYPE_PACKED in variants. + 2015-11-27 Martin Liska PR c++/68312 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 7b9ab8ae646..31de0a51e56 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -7213,7 +7213,8 @@ start_struct (location_t loc, enum tree_code code, tree name, } C_TYPE_BEING_DEFINED (ref) = 1; - TYPE_PACKED (ref) = flag_pack_struct; + for (tree v = TYPE_MAIN_VARIANT (ref); v; v = TYPE_NEXT_VARIANT (v)) + TYPE_PACKED (v) = flag_pack_struct; *enclosing_struct_parse_info = struct_parse_info; struct_parse_info = XNEW (struct c_struct_parse_info); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a4419b8acb4..23da95f08e8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-29 Jan Hubicka + + PR c/67106 + * gcc.c-torture/compile/pr67106.c: New testcase. + 2015-11-29 Jan Hubicka PR c/67581 diff --git a/gcc/testsuite/gcc.c-torture/compile/pr67106.c b/gcc/testsuite/gcc.c-torture/compile/pr67106.c new file mode 100644 index 00000000000..2a003e56f2e --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/pr67106.c @@ -0,0 +1,12 @@ +/* { dg-options "-g -fpack-struct" } */ +typedef struct S S; + +struct S +{ + struct + { + S *s; + }; + int a; +}; +