]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Revert "Fix ICE with -g and -std=c23 related to incomplete types [PR114361]"
authorMartin Uecker <uecker@tugraz.at>
Fri, 5 Apr 2024 10:14:56 +0000 (12:14 +0200)
committerMartin Uecker <uecker@tugraz.at>
Fri, 5 Apr 2024 10:17:17 +0000 (12:17 +0200)
This reverts commit 871bb5ad2dd56343d80b6a6d269e85efdc9999e5  because it
breaks LTO and needs a bit more work. See PR 114574.

gcc/c/c-decl.cc
gcc/testsuite/gcc.dg/c23-tag-incomplete-1.c [deleted file]
gcc/testsuite/gcc.dg/c23-tag-incomplete-2.c [deleted file]
gcc/testsuite/gcc.dg/pr114361.c [deleted file]

index f2083b9d96fb1b5393c3d0e3b7c6e4a6b88ba1f1..c747abe9f4effdf12402f6c730b208714e0434bb 100644 (file)
@@ -9722,7 +9722,6 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
       C_TYPE_VARIABLE_SIZE (x) = C_TYPE_VARIABLE_SIZE (t);
       C_TYPE_VARIABLY_MODIFIED (x) = C_TYPE_VARIABLY_MODIFIED (t);
       C_TYPE_INCOMPLETE_VARS (x) = NULL_TREE;
-      TYPE_CANONICAL (x) = TYPE_CANONICAL (t);
     }
 
   /* Update type location to the one of the definition, instead of e.g.
diff --git a/gcc/testsuite/gcc.dg/c23-tag-incomplete-1.c b/gcc/testsuite/gcc.dg/c23-tag-incomplete-1.c
deleted file mode 100644 (file)
index 82d6525..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-/* { dg-do compile }
- * { dg-options "-std=c23 -g" } */
-
-struct a;
-typedef struct a b;
-
-void g() {
-    struct a { b* x; };
-}
-
-struct a { b* x; };
-
-
-
diff --git a/gcc/testsuite/gcc.dg/c23-tag-incomplete-2.c b/gcc/testsuite/gcc.dg/c23-tag-incomplete-2.c
deleted file mode 100644 (file)
index bc47a04..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* { dg-do compile }
- * { dg-options "-std=c23 -g" } */
-
-struct a;
-typedef struct a b;
-
-void f() {
-       extern struct a { b* x; } t;
-}
-
-extern struct a { b* x; } t;
-
-
diff --git a/gcc/testsuite/gcc.dg/pr114361.c b/gcc/testsuite/gcc.dg/pr114361.c
deleted file mode 100644 (file)
index 0f3feb5..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-/* PR c/114361 */
-/* { dg-do compile } */
-/* { dg-options "-std=gnu23 -g" } */
-
-void f()
-{
-    typedef struct foo bar;
-    typedef __typeof( ({ (struct foo { bar *x; }){ }; }) ) wuz;
-    struct foo { wuz *x; };
-}
-