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

Andrew Pinski pinskia@physics.uc.edu
Wed Mar 10 18:37:00 GMT 2004


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);
      }



More information about the Gcc-patches mailing list