https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67106

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |hubicka at gcc dot 
gnu.org

--- Comment #3 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Actually in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66325 I already went
for variant walk.  Will thus test:
Index: c/c-decl.c
===================================================================
--- c/c-decl.c (revision 230924)
+++ c/c-decl.c (working copy)
@@ -7213,7 +7213,8 @@ start_struct (location_t loc, enum tree_
     }

   C_TYPE_BEING_DEFINED (ref) = 1;
-  TYPE_PACKED (ref) = flag_pack_struct;
+  for (tree v = TYPE_MAIN_VARIANT (ref); v; v = TYPE_NEXT_VARIANT (v))
+    TYPE_PACKED (v) = flag_pack_struct;

   *enclosing_struct_parse_info = struct_parse_info;
   struct_parse_info = XNEW (struct c_struct_parse_info);
Index: testsuite/gcc.c-torture/compile/pr67106.c
===================================================================
--- testsuite/gcc.c-torture/compile/pr67106.c (revision 0)
+++ testsuite/gcc.c-torture/compile/pr67106.c (revision 0)
@@ -0,0 +1,12 @@
+/* { dg-options "-g -fpack-struct" } */
+typedef struct S S;
+
+struct S
+{
+  struct
+  {
+    S *s;
+  };
+  int a;
+};
+

Reply via email to