aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-06-26 07:23:48 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-06-26 07:23:48 +0200
commit19dbbf3697cff8c0eb50b5ada203860c623f2cde (patch)
treea6622769868a44a89a7d8e275cb48301a392ef54
parent7a1df4e2d7d4c30d2fce7557ae13e23deb910f20 (diff)
downloadgcc-19dbbf3697cff8c0eb50b5ada203860c623f2cde.zip
gcc-19dbbf3697cff8c0eb50b5ada203860c623f2cde.tar.gz
gcc-19dbbf3697cff8c0eb50b5ada203860c623f2cde.tar.bz2
re PR middle-end/22028 (ICE after invalid struct declaration)
PR middle-end/22028 * gimplify.c (gimplify_type_sizes): Check for type == error_mark_node earlier in the function. * gcc.dg/20050620-1.c: New test. From-SVN: r101332
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/gimplify.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/20050620-1.c15
4 files changed, 26 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index aaccb6e..751cc70 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2005-06-26 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/22028
+ * gimplify.c (gimplify_type_sizes): Check for type == error_mark_node
+ earlier in the function.
+
* regrename.c (copy_value): Don't replace fixed or global
regs with older regs.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 156e567..8bc7908 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4524,15 +4524,14 @@ gimplify_type_sizes (tree type, tree *list_p)
{
tree field, t;
- if (type == NULL)
+ if (type == NULL || type == error_mark_node)
return;
/* We first do the main variant, then copy into any other variants. */
type = TYPE_MAIN_VARIANT (type);
/* Avoid infinite recursion. */
- if (TYPE_SIZES_GIMPLIFIED (type)
- || type == error_mark_node)
+ if (TYPE_SIZES_GIMPLIFIED (type))
return;
TYPE_SIZES_GIMPLIFIED (type) = 1;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7196184..a8ca329 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/22028
+ * gcc.dg/20050620-1.c: New test.
+
2005-06-26 Kazu Hirata <kazu@codesourcery.com>
PR tree-optimization/22026
diff --git a/gcc/testsuite/gcc.dg/20050620-1.c b/gcc/testsuite/gcc.dg/20050620-1.c
new file mode 100644
index 0000000..befdd96
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20050620-1.c
@@ -0,0 +1,15 @@
+/* PR middle-end/22028 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+foo (void)
+{
+ struct { int i[]; } u; /* { dg-error "flexible array member" } */
+}
+
+void
+bar (void)
+{
+ struct { struct a b; } c; /* { dg-error "has incomplete type" } */
+}