public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix TYPE_PACKED verify_type ICE
@ 2015-11-29 19:02 Jan Hubicka
  2015-11-29 19:11 ` Joseph Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Hubicka @ 2015-11-29 19:02 UTC (permalink / raw)
  To: gcc-patches, rguenther, joseph

Hi,
this patch fixes verifier ICE where we have !TYPE_PACKED variant of
TYPE_PACKED type. The fix is symmetric to earlier fix for enums.

Bootstrapped/regtested x86_64-linux, OK?

Honza

	PR c/67106
	* gcc.c-torture/compile/pr67106.c: New testcase.
	* c-decl.c: Set TYPE_PACKED in variants.
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;
+};
+
Index: c/c-decl.c
===================================================================
--- c/c-decl.c	(revision 231020)
+++ 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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix TYPE_PACKED verify_type ICE
  2015-11-29 19:02 Fix TYPE_PACKED verify_type ICE Jan Hubicka
@ 2015-11-29 19:11 ` Joseph Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Myers @ 2015-11-29 19:11 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc-patches, rguenther

On Sun, 29 Nov 2015, Jan Hubicka wrote:

> Hi,
> this patch fixes verifier ICE where we have !TYPE_PACKED variant of
> TYPE_PACKED type. The fix is symmetric to earlier fix for enums.
> 
> Bootstrapped/regtested x86_64-linux, OK?
> 
> Honza
> 
> 	PR c/67106
> 	* gcc.c-torture/compile/pr67106.c: New testcase.
> 	* c-decl.c: Set TYPE_PACKED in variants.

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-29 19:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-29 19:02 Fix TYPE_PACKED verify_type ICE Jan Hubicka
2015-11-29 19:11 ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).