OSDN Git Service

2004-12-17 Andrew Haley <aph@redhat.com>
[pf3gnuchains/gcc-fork.git] / gcc / java / expr.c
index fdc8ae6..8c1ad70 100644 (file)
@@ -1329,6 +1329,9 @@ expand_load_internal (int index, tree type, int pc)
      value into it.  Then we push this new local on the stack.
      Hopefully this all gets optimized out.  */
   copy = build_decl (VAR_DECL, NULL_TREE, type);
      value into it.  Then we push this new local on the stack.
      Hopefully this all gets optimized out.  */
   copy = build_decl (VAR_DECL, NULL_TREE, type);
+  if (INTEGRAL_TYPE_P (type)
+      && TREE_TYPE (copy) != TREE_TYPE (var))
+    var = convert (type, var);
   java_add_local_var (copy);
   java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (var), copy, var));
   
   java_add_local_var (copy);
   java_add_stmt (build2 (MODIFY_EXPR, TREE_TYPE (var), copy, var));