This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] Fix PR c/14475 ICE on undefined enum in a bit-field


This patch fixes the ICE where an undefined enum was being used in a bit-field.
The same error/warning messages from the mainline now show up also on the tree-ssa.


I applied this as obvious after testing on powerpc-apple-darwin with no regressions.

Thanks,
Andrew Pinski


ChangeLog:


	* c-decl.c (check_bitfield_type_and_width): Check for null
	lang_type_specific when check the precision of an enum.



Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.334.2.84
diff -u -p -r1.334.2.84 c-decl.c
--- c-decl.c	5 Mar 2004 23:48:04 -0000	1.334.2.84
+++ c-decl.c	10 Mar 2004 18:26:24 -0000
@@ -3214,7 +3214,8 @@ check_bitfield_type_and_width (tree *typ
   if (TREE_CODE (*type) == ENUMERAL_TYPE)
     {
       struct lang_type *lt = TYPE_LANG_SPECIFIC (*type);
-      if (w < min_precision (lt->enum_min, TREE_UNSIGNED (*type))
+      if (!lt
+          || w < min_precision (lt->enum_min, TREE_UNSIGNED (*type))
 	  || w < min_precision (lt->enum_max, TREE_UNSIGNED (*type)))
 	warning ("`%s' is narrower than values of its type", name);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]