Bug 13273 - [3.4 regression] gcj generates call to abstract method
Summary: [3.4 regression] gcj generates call to abstract method
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.0
Assignee: Andrew Haley
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2003-12-02 18:46 UTC by Tom Tromey
Modified: 2004-01-17 04:22 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-12-19 12:40:04


Attachments
test case source file (180 bytes, text/plain)
2003-12-02 18:47 UTC, Tom Tromey
Details
jikes-compiled .class files (1.18 KB, application/octet-stream)
2003-12-02 18:47 UTC, Tom Tromey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2003-12-02 18:46:03 UTC
This is a regression from 3.3.

First, compile the attached source with jikes.
The problem isn't visible if you compile to .class with
"gcj -C", as gcj generates the wrong invokespecial call
for "super.dispose()".
(I'll also attach a .jar file containing the classes as
compiled with jikes).

Then compile FieldEditorPreferencePage.class with "gcj -c".
gcj generates a call to this method:

         U IPreferencePage.dispose()

However, this is an interface method, so this call is
clearly wrong.

gcj 3.3 emits a call to:

         U DialogPage.dispose()

This is still wrong, but less so -- at least it will work.
Really we should emit a call to PreferencePage.dispose().
(This is especially true for binary compatibility.)
Comment 1 Tom Tromey 2003-12-02 18:47:05 UTC
Created attachment 5264 [details]
test case source file
Comment 2 Tom Tromey 2003-12-02 18:47:41 UTC
Created attachment 5265 [details]
jikes-compiled .class files
Comment 3 Tom Tromey 2003-12-02 18:49:29 UTC
regression; fix for 3.4
Comment 4 GCC Commits 2004-01-16 17:11:17 UTC
Subject: Bug 13273

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	aph@gcc.gnu.org	2004-01-16 17:11:11

Modified files:
	gcc/java       : typeck.c java-tree.h jcf-parse.c decl.c 
	                 ChangeLog 

Log message:
	2004-01-16  Andrew Haley  <aph@redhat.com>
	
	PR java/13273:
	* typeck.c (shallow_find_method): New.
	(find_method_in_superclasses): New.
	(find_method_in_interfaces): New.
	(lookup_do): Rewrite.
	* java-tree.h (SEARCH_ONLY_INTERFACE): Delete.
	
	* jcf-parse.c (read_class): Save and restore output_class.
	* decl.c (java_expand_body): Set output_class from fndecl.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/typeck.c.diff?cvsroot=gcc&r1=1.58&r2=1.59
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/java-tree.h.diff?cvsroot=gcc&r1=1.193&r2=1.194
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-parse.c.diff?cvsroot=gcc&r1=1.156&r2=1.157
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/decl.c.diff?cvsroot=gcc&r1=1.175&r2=1.176
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1314&r2=1.1315

Comment 5 Andrew Pinski 2004-01-16 17:25:12 UTC
Fixed for 3.4.