aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2005-09-18 17:11:11 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2005-09-18 17:11:11 +0000
commitf7952e0ac267cc56c14ebbb22c1815a23ad3cf2e (patch)
treebd858064ac0c391fa4c072dc6b97e1ee2e7cc8db /gcc/varasm.c
parent30bf3b40e6ecbfcdd67518a7cf8b8bf9b2fb18c1 (diff)
downloadgcc-f7952e0ac267cc56c14ebbb22c1815a23ad3cf2e.zip
gcc-f7952e0ac267cc56c14ebbb22c1815a23ad3cf2e.tar.gz
gcc-f7952e0ac267cc56c14ebbb22c1815a23ad3cf2e.tar.bz2
varasm.c (output_constant): Do not abort on conversions to union types between different sizes.
* varasm.c (output_constant): Do not abort on conversions to union types between different sizes. From-SVN: r104404
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index a258c9e..91d2ea0c 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -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);