aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorJim Wilson <jim.wilson@linaro.org>2015-10-28 20:02:01 +0000
committerJim Wilson <wilson@gcc.gnu.org>2015-10-28 13:02:01 -0700
commite922069e4f3e5dfadb59f641db6786feff9c6047 (patch)
tree23d238e1d6b8f3b3e2be57ce8a27c84536c31705 /gcc/c
parent08585fba891c73790a3a4354bc26f0fe02be4d9c (diff)
downloadgcc-e922069e4f3e5dfadb59f641db6786feff9c6047.zip
gcc-e922069e4f3e5dfadb59f641db6786feff9c6047.tar.gz
gcc-e922069e4f3e5dfadb59f641db6786feff9c6047.tar.bz2
Fix for ICE with -g on testcase with incomplete types.
gcc/c/ PR debug/66068 * c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS after calling build_qualified_type. gcc/testsuite/ PR debug/66068 * gcc.dg/debug/pr66068.c: New test. From-SVN: r229505
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 78597be..d203f9d 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-26 Jim Wilson <jim.wilson@linaro.org>
+
+ PR debug/66068
+ * c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_VARS
+ after calling build_qualified_type.
+
2015-10-27 Cesar Philippidis <cesar@codesourcery.com>
Thomas Schwinge <thomas@codesourcery.com>
James Norris <jnorris@codesourcery.com>
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 64ea1c2..1b0b9e2 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -13126,7 +13126,13 @@ c_build_qualified_type (tree type, int type_quals)
type_quals &= ~TYPE_QUAL_RESTRICT;
}
- return build_qualified_type (type, type_quals);
+ tree var_type = build_qualified_type (type, type_quals);
+ /* A variant type does not inherit the list of incomplete vars from the
+ type main variant. */
+ if (TREE_CODE (var_type) == RECORD_TYPE
+ || TREE_CODE (var_type) == UNION_TYPE)
+ C_TYPE_INCOMPLETE_VARS (var_type) = 0;
+ return var_type;
}
/* Build a VA_ARG_EXPR for the C parser. */