public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: middle-end/6608: code generation bug when building libgcj
@ 2003-03-22 14:47 ebotcazou
  0 siblings, 0 replies; 3+ messages in thread
From: ebotcazou @ 2003-03-22 14:47 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, tromey

Synopsis: code generation bug when building libgcj

State-Changed-From-To: open->feedback
State-Changed-By: ebotcazou
State-Changed-When: Sat Mar 22 14:47:35 2003
State-Changed-Why:
    Tom, what is the status of this bug on the various branches?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6608


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

* Re: middle-end/6608: code generation bug when building libgcj
@ 2003-03-26 17:16 tromey
  0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2003-03-26 17:16 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, tromey

Synopsis: code generation bug when building libgcj

State-Changed-From-To: feedback->closed
State-Changed-By: tromey
State-Changed-When: Wed Mar 26 17:15:20 2003
State-Changed-Why:
    This appears to have been fixed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6608


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

* middle-end/6608: code generation bug when building libgcj
@ 2002-05-08 11:36 tromey
  0 siblings, 0 replies; 3+ messages in thread
From: tromey @ 2002-05-08 11:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6608
>Category:       middle-end
>Synopsis:       code generation bug when building libgcj
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 08 11:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Tom Tromey
>Release:        gcj (GCC) 3.2 20020505 (experimental)
>Organization:
>Environment:

>Description:
I've found what I believe to be a code generation bug on the current
cvs trunk.

The bug apparently occurs when compiling the libgcj class
java.lang.reflect.Modifier, in method isPublic().

The test case below, from the libgcj test suite, demonstrates the bug.

It prints this:

    public private void KeepInline.example()
    public static void KeepInline.main(java.lang.String[])

Note the "public private".

Here is what I see if I go to Modifier.isPublic in gdb:

    java.lang.reflect.Modifier.isPublic(int) (mod=2)
	at ../../../gcc/libjava/java/lang/reflect/Modifier.java:227
    (gdb) p mod
    $5 = 2
    (gdb) fini
    Run till exit from #0  java.lang.reflect.Modifier.isPublic(int) (mod=2)
	at ../../../gcc/libjava/java/lang/reflect/Modifier.java:227
    0x40359dc1 in java.lang.reflect.Modifier.toString(int, java.lang.StringBuffer)
	(mod=2, r=@80b5be0)
	at ../../../gcc/libjava/java/lang/reflect/Modifier.java:302
    Value returned is $6 = 2

This return value is wrong in two ways:

* First, PUBLIC is 1, so the return value should be 0
* Second, the method returns a boolean so `2' is invalid anyway

// Demonstrate that private methods can be reflected even if they are
// not referenced at compile-time (i.e. -fkeep-inline-functions works).
import java.lang.reflect.Method;
public class KeepInline {
  private void example() {
    System.out.println("example");
  }
  public static void main(String[] args) {
    try {
      KeepInline pr = new KeepInline();
      Method[] meths = pr.getClass().getDeclaredMethods();
      for (int n = 0; n < meths.length; n++)
        System.out.println(meths[n]);
    } catch (Throwable t) {
      t.printStackTrace();
    }
  }
}
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2003-03-26 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22 14:47 middle-end/6608: code generation bug when building libgcj ebotcazou
  -- strict thread matches above, loose matches on Subject: below --
2003-03-26 17:16 tromey
2002-05-08 11:36 tromey

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