public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: java/9861: method name mangling ignores return type
@ 2003-04-11 13:00 aph
  0 siblings, 0 replies; 2+ messages in thread
From: aph @ 2003-04-11 13:00 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, java-prs, nobody, sf

Synopsis: method name mangling ignores return type

State-Changed-From-To: open->analyzed
State-Changed-By: aph
State-Changed-When: Fri Apr 11 13:00:04 2003
State-Changed-Why:
    Ouch.  I don't see how we can fix this without breaking CNI
    compatibility with C++.

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


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

* java/9861: method name mangling ignores return type
@ 2003-02-26 13:36 sf
  0 siblings, 0 replies; 2+ messages in thread
From: sf @ 2003-02-26 13:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9861
>Category:       java
>Synopsis:       method name mangling ignores return type
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 26 13:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     sf@b-i-t.de
>Release:        gcc-3.2.1
>Organization:
>Environment:
gentoo linux 1.4
gcc version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207)
GNU assembler version 2.13.90.0.18 (i586-pc-linux-gnu) using BFD version 2.13.90.0.18 20030121
>Description:
The following Generic Java code was compiled to the two classes which can be found in the attachment.

// TestGJ.java begins here

class Test<Type> {

  protected Type x () {
    return null;
  }
}

public class TestGJ extends Test<Integer> {

  protected Integer x () {
    return new Integer (1);
  }

  public static void main (final String[] argv) {
    new TestGJ ().x ().intValue ();
  }
}

// TestGJ.java ends here

If you execute "java TestGJ" (adjust CLASSPATH as necessary) the program runs without error (BTW, there is no output).

But compilation of the class files with gcj fails because of a name clash during assembly.
>How-To-Repeat:
If you execute

gcj -classpath /usr/share/gcc-data/i586-pc-linux-gnu/3.2/java/libgcj-3.2.1.jar:. Test.class TestGJ.class 

you should get output similar to

/tmp/cc5J7vu9.s: Assembler messages:
/tmp/cc5J7vu9.s:150: Error: symbol `_ZN6TestGJ1xEv' is already defined
>Fix:
The mangled name of a method must contain the method's return type, as in the definition of a method descriptor in the Java Virtual Machine Specification.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/x-zip-compressed; name="TestGJ.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="TestGJ.zip"

UEsDBBQAAgAIACtvWi4xD4R7xwAAACYBAAAKAAAAVGVzdC5jbGFzc21PzQ7BYBCcrdIf/4kHcGwJ
7oiLhEQkDhr3qi9Nm6aEEt6Kk8TBA3gosV85YZPNTHZmJ7uP5+2ODFqomgwlDWUNFUKuH8RBMiBk
LHtBUIfrlSDQkVCz7GnoHtxO5MZ+Z7YMhZf0CMY88GM32W/Zplu245w2gsfNviTd343BvxBzvt5v
PTEKIk7JO2KXjCdt6StARZbPkCNC5XsVdSh8vSyFm73gF5hVGYkx27iCLqlBhQadbVIufWSFzqlm
pAEm95vlUUix+AJQSwMEFAACAAgAK29aLvdFNsQ6AQAA6QEAAAwAAABUZXN0R0ouY2xhc3NtkN1K
AkEUx/+jq+uuW2apfdiXd2tQPoDiTVAYQheGIV1tNmwjNsI2Rr1V3Sgk9AA9VHTOKpTUXJwzM+f3
P1+fX+8fSOIYFRcZlGxsukhgy8a2Cws7bMr8s2tjTyDdUFqZpkDSr3YFrNPRnRQQzwJFv9oeBE9B
bRjosNbSRoYyqhPyECgtUPJvfoU7JlI6rHOKwpLu8nYg+4ZkTudFm3tpVJ/vKtSBGUdUqty+ko+m
8U+pJqnczmgc9eWZGhKaZfL84oRRDw5cgfwfGQf2aa45G2MePKx4OMAhdc//5PwW95pR2nSD4VjG
87dQoeVkwMeCYCnZLL3y5AX51NEU4m0BUNJFuEj75rAzQ6JnTZF8jREHq8gtkDJtnJHcDFZvitQE
6Qns659cawQslyJknicf2wTWY7uBQuyL31BLAQIXAxQAAgAIACtvWi4xD4R7xwAAACYBAAAKAAAA
AAAAAAAAAACkgQAAAABUZXN0LmNsYXNzUEsBAhcDFAACAAgAK29aLvdFNsQ6AQAA6QEAAAwAAAAA
AAAAAAAAAKSB7wAAAFRlc3RHSi5jbGFzc1BLBQYAAAAAAgACAHIAAABTAgAAAAA=


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

end of thread, other threads:[~2003-04-11 13:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-11 13:00 java/9861: method name mangling ignores return type aph
  -- strict thread matches above, loose matches on Subject: below --
2003-02-26 13:36 sf

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