* varasm.c (output_constant): Do not abort on conversions to union
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Sep 2005 17:11:11 +0000 (17:11 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 18 Sep 2005 17:11:11 +0000 (17:11 +0000)
types between different sizes.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104404 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/varasm.c

index eb03f70..ffe4d2b 100644 (file)
@@ -1,3 +1,8 @@
+2005-09-18  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * varasm.c (output_constant): Do not abort on conversions to union
+       types between different sizes.
+
 2005-09-18  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/23944
index a258c9e..91d2ea0 100644 (file)
@@ -3881,8 +3881,11 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
       HOST_WIDE_INT op_size = int_size_in_bytes (TREE_TYPE (TREE_OPERAND (exp, 0)));
 
       /* Make sure eliminating the conversion is really a no-op, except with
-        VIEW_CONVERT_EXPR to allow for wild Ada unchecked conversions.  */
-      if (type_size != op_size && TREE_CODE (exp) != VIEW_CONVERT_EXPR)
+        VIEW_CONVERT_EXPRs to allow for wild Ada unchecked conversions and
+        union types to allow for Ada unchecked unions.  */
+      if (type_size != op_size
+         && TREE_CODE (exp) != VIEW_CONVERT_EXPR
+         && TREE_CODE (TREE_TYPE (exp)) != UNION_TYPE)
        internal_error ("no-op convert from %wd to %wd bytes in initializer",
                        op_size, type_size);