SOURCES: gcc-pr22028.patch (NEW) - fix error-recovery ice.

pluto pluto at pld-linux.org
Fri Jun 24 13:34:40 CEST 2005


Author: pluto                        Date: Fri Jun 24 11:34:40 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix error-recovery ice.

---- Files affected:
SOURCES:
   gcc-pr22028.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/gcc-pr22028.patch
diff -u /dev/null SOURCES/gcc-pr22028.patch:1.1
--- /dev/null	Fri Jun 24 13:34:40 2005
+++ SOURCES/gcc-pr22028.patch	Fri Jun 24 13:34:35 2005
@@ -0,0 +1,58 @@
+Date: Mon, 20 Jun 2005 08:11:27 -0400
+From: Jakub Jelinek <jakub at redhat dot com>
+Subject: [PATCH] Fix PR middle-end/22028
+
+Hi!
+
+Apparently my PR c/21536 fix causes ICE on some invalid testcases.
+error_mark_node has no TYPE_MAIN_VARIANT and so leads to either
+checking failures (with checking enabled) or crashes (otherwise).
+error_mark_node is checked afterwards anyway, so just moving the
+check earlier fixes it.
+
+2005-06-20  Jakub Jelinek  <jakub at redhat.com>
+
+	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.
+
+--- a/gcc/gimplify.c	2005-06-20 12:38:45.000000000 +0200
++++ b/gcc/gimplify.c	2005-06-20 13:47:26.000000000 +0200
+@@ -4484,15 +4484,14 @@ gimplify_type_sizes (tree type, tree *li
+ {
+   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;
+--- a/gcc/testsuite/gcc.dg/20050620-1.c	2005-06-20 13:53:30.000000000 +0200
++++ b/gcc/testsuite/gcc.dg/20050620-1.c	2005-06-20 13:51:55.000000000 +0200
+@@ -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" } */
++}
================================================================



More information about the pld-cvs-commit mailing list