+2010-01-12 Joseph Myers <joseph@codesourcery.com>
+
+ PR c/42708
+ * c-typeck.c (build_c_cast): Fold value cast to union type before
+ wrapping it in a CONSTRUCTOR.
+
2010-01-12 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/42699
if (field)
{
tree t;
+ bool maybe_const = true;
pedwarn (loc, OPT_pedantic, "ISO C forbids casts to union type");
- t = digest_init (loc, type,
- build_constructor_single (type, field, value),
+ t = c_fully_fold (value, false, &maybe_const);
+ t = build_constructor_single (type, field, t);
+ if (!maybe_const)
+ t = c_wrap_maybe_const (t, true);
+ t = digest_init (loc, type, t,
NULL_TREE, false, true, 0);
TREE_CONSTANT (t) = TREE_CONSTANT (value);
return t;