public inbox for java-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/21115] New: false boolean argument passed from pre-compiled to interpreted method is true
@ 2005-04-19 22:30 mark at gcc dot gnu dot org
  2005-04-19 22:55 ` [Bug java/21115] " daney at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: mark at gcc dot gnu dot org @ 2005-04-19 22:30 UTC (permalink / raw)
  To: java-prs

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2005-04-29 19:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-19 22:30 [Bug java/21115] New: false boolean argument passed from pre-compiled to interpreted method is true mark at gcc dot gnu dot org
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

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).