From 75c8aac3cee7f1a7eda2c58f9b59ce4925509862 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 29 Nov 2015 20:48:45 +0100 Subject: [PATCH] re PR c++/67581 (ICE on transparent union with -g enabled on x86_64-linux-gnu (verify_type failed)) PR c/67581 * g++.dg/torture/pr67581.C: New testcase. * c-family/c-common.c (handle_transparent_union_attribute): Update also type variants. From-SVN: r231048 --- gcc/c-family/ChangeLog | 6 ++++++ gcc/c-family/c-common.c | 3 ++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/torture/pr67581.C | 6 ++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/torture/pr67581.C diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index ad0fbc1c735..f8fa0b2b376 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2015-11-29 Jan Hubicka + + PR c/67581 + * c-common.c (handle_transparent_union_attribute): Update + also type variants. + 2015-11-27 Martin Liska PR c++/68312 diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index fe0a235988f..369574f44de 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -7787,7 +7787,8 @@ handle_transparent_union_attribute (tree *node, tree name, *node = type = build_duplicate_type (type); } - TYPE_TRANSPARENT_AGGR (type) = 1; + for (tree t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t)) + TYPE_TRANSPARENT_AGGR (t) = 1; return NULL_TREE; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d58666e1bf9..a4419b8acb4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-29 Jan Hubicka + + PR c/67581 + * g++.dg/torture/pr67581.C: New testcase. + 2015-11-27 Richard Biener PR tree-optimization/68559 diff --git a/gcc/testsuite/g++.dg/torture/pr67581.C b/gcc/testsuite/g++.dg/torture/pr67581.C new file mode 100644 index 00000000000..8089c1fcb2e --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr67581.C @@ -0,0 +1,6 @@ +/* { dg-do compile } */ +union U +{ + int x; + float y; +} __attribute__ ((__transparent_union__)); -- 2.30.2