OSDN Git Service

2010-03-24 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
[pf3gnuchains/gcc-fork.git] / gcc / gimplify.c
index 8f19ced..66b6b52 100644 (file)
@@ -31,6 +31,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-iterator.h"
 #include "tree-inline.h"
 #include "diagnostic.h"
+#include "tree-pretty-print.h"
 #include "langhooks.h"
 #include "langhooks-def.h"
 #include "tree-flow.h"
@@ -39,7 +40,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "except.h"
 #include "hashtab.h"
 #include "flags.h"
-#include "real.h"
 #include "function.h"
 #include "output.h"
 #include "expr.h"
@@ -3813,8 +3813,11 @@ gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
                if (notify_temp_creation)
                  return GS_ERROR;
 
-               walk_tree (&ctor, force_labels_r, NULL, NULL);
-               TREE_OPERAND (*expr_p, 1) = tree_output_constant_def (ctor);
+               walk_tree (&ctor, force_labels_r, NULL, NULL);
+               ctor = tree_output_constant_def (ctor);
+               if (!useless_type_conversion_p (type, TREE_TYPE (ctor)))
+                 ctor = build1 (VIEW_CONVERT_EXPR, type, ctor);
+               TREE_OPERAND (*expr_p, 1) = ctor;
 
                /* This is no longer an assignment of a CONSTRUCTOR, but
                   we still may have processing to do on the LHS.  So