2003-11-06 Andrew Haley <aph@redhat.com>
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Nov 2003 15:19:49 +0000 (15:19 +0000)
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Nov 2003 15:19:49 +0000 (15:19 +0000)
        * expr.c (java_stack_swap): Make sure destination stack slots are
        of the correct type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73306 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/java/ChangeLog
gcc/java/expr.c

index a1e76ce..4de89c5 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-06  Andrew Haley  <aph@redhat.com>
+
+       * expr.c (java_stack_swap): Make sure destination stack slots are
+       of the correct type.
+
 2003-11-03  Kelley Cook  <kcook@gcc.gnu.org>
 
        * Make-lang.in (dvi): Move targets to $(docobjdir).
index e5654e7..8e7ea9d 100644 (file)
@@ -503,8 +503,9 @@ java_stack_swap (void)
   decl1 = find_stack_slot (stack_pointer - 1, type1);
   decl2 = find_stack_slot (stack_pointer - 2, type2);
   temp = copy_to_reg (DECL_RTL (decl1));
-  emit_move_insn (DECL_RTL (decl1), DECL_RTL (decl2));
-  emit_move_insn (DECL_RTL (decl2), temp);
+  emit_move_insn (DECL_RTL (find_stack_slot (stack_pointer - 1, type2)), 
+                 DECL_RTL (decl2));
+  emit_move_insn (DECL_RTL (find_stack_slot (stack_pointer - 2, type1)), temp);
   stack_type_map[stack_pointer - 1] = type2;
   stack_type_map[stack_pointer - 2] = type1;
 }