public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
From: "mark at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: java-prs@gcc.gnu.org
Subject: [Bug java/21115] New: false boolean argument passed from pre-compiled to interpreted method is true
Date: Tue, 19 Apr 2005 22:30:00 -0000	[thread overview]
Message-ID: <20050419223032.21115.mark@gcc.gnu.org> (raw)

This is reduced from the eclipse problem I was seeing.
Compile the following Test.java with gcj --main=Test Test.java

public abstract class Test
{
  public static void main(String[] args) throws Exception
  {
    Class c = Class.forName("Invoke");
    Object o = c.newInstance();
    Test t = (Test) o;
    t.test("FALSE", false);
    t.test("TRUE", true);
  }

  public abstract boolean test(String s, boolean b);
}

Compile the Invoke.java class with gcj -C:

public class Invoke extends Test
{
  public boolean test(String s, boolean b)
  {
    if (b)
      System.out.println(s + ": TRUE!");
    else
      System.out.println(s + ": FALSE!");
    return b;
  }
}

Then run the expected output is:

FALSE: FALSE!
TRUE: TRUE!

But when running ./a.out you will get:

FALSE: TRUE!
TRUE: TRUE!

Running this completely interpreted (gcj -C Test.java; gij Test) produces the
correct output. It also works correctly on powerpc-unknown-linux-gnu (either
partly pre-compiled or fully interpreted).

-- 
           Summary: false boolean argument passed from pre-compiled to
                    interpreted method is true
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mark at gcc dot gnu dot org
                CC: aph at redhat dot com,gcc-bugs at gcc dot gnu dot
                    org,java-prs at gcc dot gnu dot org,tromey at redhat dot
                    com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21115


             reply	other threads:[~2005-04-19 22:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-19 22:30 mark at gcc dot gnu dot org [this message]
2005-04-19 22:55 ` [Bug java/21115] " daney at gcc dot gnu dot org
2005-04-19 23:35 ` [Bug libgcj/21115] " pinskia at gcc dot gnu dot org
2005-04-20  0:50 ` green at redhat dot com
2005-04-20  0:57 ` pinskia at gcc dot gnu dot org
2005-04-20  1:37 ` tromey at gcc dot gnu dot org
2005-04-20  5:06 ` green at redhat dot com
2005-04-20 14:07 ` pinskia at gcc dot gnu dot org
2005-04-20 14:30 ` mark at gcc dot gnu dot org
2005-04-20 14:38 ` aph at gcc dot gnu dot org
2005-04-21 13:38 ` aph at gcc dot gnu dot org
2005-04-21 15:02 ` [Bug java/21115] " aph at gcc dot gnu dot org
2005-04-21 16:04 ` [Bug libgcj/21115] " mark at gcc dot gnu dot org
2005-04-21 16:06 ` [Bug java/21115] " pinskia at gcc dot gnu dot org
2005-04-21 16:23 ` cvs-commit at gcc dot gnu dot org
2005-04-28 16:35 ` cvs-commit at gcc dot gnu dot org
2005-04-29 18:43 ` cvs-commit at gcc dot gnu dot org
2005-04-29 18:44 ` cvs-commit at gcc dot gnu dot org
2005-04-29 19:24 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050419223032.21115.mark@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=java-prs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).