]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/27421 (ICE with invalid array in struct)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 12 Jun 2006 21:39:10 +0000 (21:39 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 12 Jun 2006 21:39:10 +0000 (21:39 +0000)
PR target/27421
* config/i386/i386.c (classify_argument): Skip fields with invalid
types in unions.

* gcc.dg/union-3.c: New test.

From-SVN: r114584

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/union-3.c [new file with mode: 0644]

index d1fdb162280d2004c47135b10d67653156d77f2b..c7e0d4651f0c2e671aacaf37c5c93d44d1b4db82 100644 (file)
@@ -1,3 +1,9 @@
+2006-06-12  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR target/27421
+       * config/i386/i386.c (classify_argument): Skip fields with invalid
+       types in unions.
+
 2006-06-06  Roger Sayle  <roger@eyesopen.com>
 
        PR target/26223
index 209e8363b9b5181e42fffb5e9ab6f6fa84ef5857..395d0be963335b8ef2efc4addf22c5ca7e780efd 100644 (file)
@@ -2345,6 +2345,10 @@ classify_argument (enum machine_mode mode, tree type,
              if (TREE_CODE (field) == FIELD_DECL)
                {
                  int num;
+
+                 if (TREE_TYPE (field) == error_mark_node)
+                   continue;
+
                  num = classify_argument (TYPE_MODE (TREE_TYPE (field)),
                                           TREE_TYPE (field), subclasses,
                                           bit_offset);
index 6ae8ee10960bf759d38ec01916c37ac001ab5842..e97f71dd586aaec9c39d9d426f85ea801420f17f 100644 (file)
@@ -1,5 +1,8 @@
 2006-06-12  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
+       PR target/27421
+       * gcc.dg/union-3.c: New test.
+
        PR c++/27933
        * g++.dg/lookup/using15.C: New test.
 
diff --git a/gcc/testsuite/gcc.dg/union-3.c b/gcc/testsuite/gcc.dg/union-3.c
new file mode 100644 (file)
index 0000000..3e89b75
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR target/27421 */
+/* { dg-do compile } */
+
+union A
+{
+  int i;
+  void x[1];  /* { dg-error "array of voids" } */
+};
+
+void foo(union A a) {}