]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
varasm.c (output_constant): Do not abort on conversions to union types between differ...
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 18 Sep 2005 17:11:11 +0000 (17:11 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 18 Sep 2005 17:11:11 +0000 (17:11 +0000)
* varasm.c (output_constant): Do not abort on conversions to union
types between different sizes.

From-SVN: r104404

gcc/ChangeLog
gcc/varasm.c

index eb03f70d6ed58c062e692ce4992741004929657e..ffe4d2b97a43e9cadf9536b45d02d592492d9d57 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 a258c9e66797fdca1ade1235ac6d946658f5d4a2..91d2ea0c8179a738962c49b5f491f27fc3a12dfa 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);