public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix verify_type ICE with -fshort-enum
@ 2015-06-11 21:49 Jan Hubicka
  2015-06-12  8:53 ` Marek Polacek
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Hubicka @ 2015-06-11 21:49 UTC (permalink / raw)
  To: gcc-patches

Hi,
gcc.c-torture/execute/930408-1.c currently ICE on -fshort-enum target(s) because
TYPE_PACKED is not consistently set among type variants.

Bootstrapped/regtested ppc64le-linux, OK?
Honza

	PR middle-end/66325
	* c-decl.c (start_enum): Set TYPE_PACKED consistently among type variants.
Index: c-decl.c
===================================================================
--- c-decl.c	(revision 224250)
+++ c-decl.c	(working copy)
@@ -7946,7 +7946,8 @@
   the_enum->enum_overflow = 0;
 
   if (flag_short_enums)
-    TYPE_PACKED (enumtype) = 1;
+    for (tree v = TYPE_MAIN_VARIANT (enumtype); v ;v = TYPE_NEXT_VARIANT (v))
+      TYPE_PACKED (v) = 1;
 
   /* FIXME: This will issue a warning for a use of a type defined
      within sizeof in a statement expr.  This is not terribly serious

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

end of thread, other threads:[~2015-06-17 10:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-11 21:49 Fix verify_type ICE with -fshort-enum Jan Hubicka
2015-06-12  8:53 ` Marek Polacek
2015-06-16 11:14   ` Richard Biener
2015-06-16 22:16     ` Jan Hubicka
2015-06-17 10:51       ` Richard Biener

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).