]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/34601 (ICE with undefined enum)
authorRichard Guenther <rguenther@suse.de>
Sun, 13 Jan 2008 16:30:51 +0000 (16:30 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Sun, 13 Jan 2008 16:30:51 +0000 (16:30 +0000)
2008-01-13  Richard Guenther  <rguenther@suse.de>

PR middle-end/34601
* emit-rtl.c (set_reg_attrs_for_decl_rtl): Use DECL_MODE
instead of TYPE_MODE to deal with calls from expand_one_error_var.

* gcc.dg/noncompile/incomplete-4.c: New testcase.

From-SVN: r131506

gcc/ChangeLog
gcc/emit-rtl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/noncompile/incomplete-4.c [new file with mode: 0644]

index 9ea747dcf1f78f7e0134b8025cadfd0bafcba9e1..27b488216c917b28372eecbb47bd4d0901796bd3 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-13  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/34601
+       * emit-rtl.c (set_reg_attrs_for_decl_rtl): Use DECL_MODE
+       instead of TYPE_MODE to deal with calls from expand_one_error_var.
+
 2008-01-13  Uros Bizjak  <ubizjak@gmail.com>
 
        * gcse.c (cprop_jump): Call validate_unshare_change instead of
index 5a2aede40ddc740601896073da727c37d5182cc7..bef4d58f53d03419be4b4acc3fa67979c9c99c49 100644 (file)
@@ -1006,7 +1006,7 @@ set_reg_attrs_for_decl_rtl (tree t, rtx x)
   if (REG_P (x))
     REG_ATTRS (x)
       = get_reg_attrs (t, byte_lowpart_offset (GET_MODE (x),
-                                              TYPE_MODE (TREE_TYPE (t))));
+                                              DECL_MODE (t)));
   if (GET_CODE (x) == CONCAT)
     {
       if (REG_P (XEXP (x, 0)))
index b067970ec88dc3ae2b7dd04ab0a84ac0f81615dd..521407af5acf5e7af2165868fc2535099f9fd86d 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-13  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/34601
+       * gcc.dg/noncompile/incomplete-4.c: New testcase.
+
 2008-01-13  Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/32135
diff --git a/gcc/testsuite/gcc.dg/noncompile/incomplete-4.c b/gcc/testsuite/gcc.dg/noncompile/incomplete-4.c
new file mode 100644 (file)
index 0000000..a4f4769
--- /dev/null
@@ -0,0 +1,4 @@
+void foo()
+{
+  enum E e; /* { dg-error "storage size" } */
+}