OSDN Git Service

gcc/java
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Sep 2006 19:00:48 +0000 (19:00 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 12 Sep 2006 19:00:48 +0000 (19:00 +0000)
PR java/29013:
* jcf-write.c (generate_bytecode_insns) <CALL_EXPR>: Always note
the push of the called method's return result.
libjava
PR java/29013:
* testsuite/libjava.lang/PR29013.out: Likewise.
* testsuite/libjava.lang/PR29013.java: New file.

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

gcc/java/ChangeLog
gcc/java/jcf-write.c
libjava/ChangeLog
libjava/testsuite/libjava.lang/PR29013.java [new file with mode: 0644]
libjava/testsuite/libjava.lang/PR29013.out [new file with mode: 0644]

index 5ffb6df..af1c42b 100644 (file)
@@ -1,5 +1,11 @@
 2006-09-12  Tom Tromey  <tromey@redhat.com>
 
+       PR java/29013:
+       * jcf-write.c (generate_bytecode_insns) <CALL_EXPR>: Always note
+       the push of the called method's return result.
+
+2006-09-12  Tom Tromey  <tromey@redhat.com>
+
        * jvspec.c (lang_specific_driver): Read spec file even if
        -fsyntax-only.
 
index aa4d33b..b68ec25 100644 (file)
@@ -2651,10 +2651,14 @@ generate_bytecode_insns (tree exp, int target, struct jcf_partial *state)
            if (TREE_CODE (f) != VOID_TYPE)
              {
                int size = TYPE_IS_WIDE (f) ? 2 : 1;
+               /* Always note the push here, so that we correctly
+                  compute the required maximum stack size.  */
+               NOTE_PUSH (size);
                if (target == IGNORE_TARGET)
-                 emit_pop (size, state);
-               else
-                 NOTE_PUSH (size);
+                 {
+                   emit_pop (size, state);
+                   NOTE_POP (size);
+                 }
              }
            break;
          }
index 7e27a66..da8704f 100644 (file)
@@ -1,5 +1,11 @@
 2006-09-12  Tom Tromey  <tromey@redhat.com>
 
+       PR java/29013:
+       * testsuite/libjava.lang/PR29013.out: Likewise.
+       * testsuite/libjava.lang/PR29013.java: New file.
+
+2006-09-12  Tom Tromey  <tromey@redhat.com>
+
        * testsuite/libjava.jacks/jacks.exp (load_gcc_lib): Removed.
 
 2006-09-07  Matthias Klose  <doko@debian.org>
diff --git a/libjava/testsuite/libjava.lang/PR29013.java b/libjava/testsuite/libjava.lang/PR29013.java
new file mode 100644 (file)
index 0000000..942ba97
--- /dev/null
@@ -0,0 +1,9 @@
+public class PR29013 {
+  public static int result() { return 5; }
+
+  public static void computeResult() { result(); }
+
+  public static void main(String[] args) {
+    computeResult();
+  }
+}
diff --git a/libjava/testsuite/libjava.lang/PR29013.out b/libjava/testsuite/libjava.lang/PR29013.out
new file mode 100644 (file)
index 0000000..e69de29