diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-11-29 20:50:04 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-11-29 19:50:04 +0000 |
commit | a4850ce9b58d12158248dc7fbe1015646757c813 (patch) | |
tree | 5038fae98694c34510484420846183c60625e9c7 | |
parent | 75c8aac3cee7f1a7eda2c58f9b59ce4925509862 (diff) | |
download | gcc-a4850ce9b58d12158248dc7fbe1015646757c813.zip gcc-a4850ce9b58d12158248dc7fbe1015646757c813.tar.gz gcc-a4850ce9b58d12158248dc7fbe1015646757c813.tar.bz2 |
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
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.c-torture/compile/pr67106.c | 12 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index ffa365c..0655aef 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2015-11-29 Jan Hubicka <hubicka@ucw.cz> + + PR c/67106 + * c-decl.c: Set TYPE_PACKED in variants. + 2015-11-27 Martin Liska <mliska@suse.cz> PR c++/68312 diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 7b9ab8a..31de0a5 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 a4419b8..23da95f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2015-11-29 Jan Hubicka <hubicka@ucw.cz> + PR c/67106 + * gcc.c-torture/compile/pr67106.c: New testcase. + +2015-11-29 Jan Hubicka <hubicka@ucw.cz> + PR c/67581 * g++.dg/torture/pr67581.C: New testcase. 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 0000000..2a003e5 --- /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; +}; + |