Bug 13252

Summary: gcj bug handling qualified "super"
Product: gcc Reporter: Rutger Ovidius <ovid>
Component: javaAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, java-prs
Priority: P2 Keywords: rejects-valid
Version: 3.4.0   
Target Milestone: 4.3.0   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2005-05-09 00:38:55
Bug Depends on: 28067    
Bug Blocks:    

Description Rutger Ovidius 2003-12-01 02:27:34 UTC
public class One {
   public Object A() {
      return new Object();
   }
}
public class Two extends One {
     public void B () {
          Object obj = Two.super.A();
     }
     public static void main(String[] args)
     {}
}

gcj -c *.java

Two.java:5: error: 'class' or 'this' expected.
                Object obj = Two.super.A ()


javac *.java works fine.

If I make "A" return void:

---
One: public A() {}
Two: public void B {} { Two.super.A(); }
---
I get:

gcj -c *.java
Two.java:5: error: '(' expected.
                Two.super.A ();

The original code I am trying to compile from .java is from jface
(eclipse):

    protected Control createContents(final Composite parent) {
        final Control[] control = new Control[1];
        BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
            public void run() {
                control[0] = PreferenceDialog.super.createContents(parent);
                // Add the first page
                selectSavedItem();
            }
        });
        return control[0];
    }

This returns a:
org\eclipse\jface\preference\PreferenceDialog.java:294: error: 'class' 
or 'this' expected.
                                control[0] = 
PreferenceDialog.super.createContents(parent);

gcc version 3.4 20031123 (experimental)   (thisiscool win32 build)
Comment 1 Andrew Pinski 2003-12-01 03:14:27 UTC
Confirmed.
Comment 2 Giovanni Bajo 2004-01-14 04:32:41 UTC
Is this a regression? I have java build online with mainline here.
Comment 3 Andrew Pinski 2004-01-14 04:40:03 UTC
I also confirmed it on 3.0.4, 3.2.3, and 3.3.1 with the same error message so this is not a 
regression.
Comment 4 Paul Brook 2004-01-20 15:45:14 UTC
*** Bug 12842 has been marked as a duplicate of this bug. ***
Comment 5 GCC Commits 2004-04-04 23:27:59 UTC
Subject: Bug 13252

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	tree-ssa-20020619-branch
Changes by:	pbrook@gcc.gnu.org	2004-04-04 23:27:51

Modified files:
	gcc/fortran    : ChangeLog f95-lang.c gfortran.h trans-array.c 
	                 trans-common.c trans-const.c trans-const.h 
	                 trans-decl.c trans-expr.c trans-intrinsic.c 
	                 trans-io.c trans-stmt.c trans-types.c 
	                 trans-types.h trans.h 
	gcc/testsuite  : ChangeLog.tree-ssa 
Added files:
	gcc/testsuite/gfortran.fortran-torture/execute: strarray_1.f90 
	                                                strarray_2.f90 
	                                                strarray_3.f90 
	                                                strarray_4.f90 
	                                                strcommon_1.f90 

Log message:
	PR 13252
	PR 14081
	* f95-lang.c (gfc_init_builtin_functions): Add stack_alloc, stack_save
	and stack_restore.
	* gfortran.h (struct gfc_charlen): Add backend_decl.
	* trans-array.c (gfc_trans_allocate_temp_array,
	gfc_conv_temp_array_ref, gfc_conv_resolve_dependencies,
	(gfc_conv_loop_setup, gfc_array_allocate, gfc_conv_array_init_size):
	Remove old, broken string handling.
	(gfc_trans_auto_array_allocation, gfc_trans_g77_array,
	gfc_trans_dummy_array_bias, gfc_conv_expr_descriptor,
	gfc_trans_deferred_array): Handle character arrays.
	* trans-const.c (gfc_conv_const_charlen): New function.
	* trans-const.h (gfc_conv_const_charlen): Add prototype.
	* trans-decl.c (gfc_finish_var_decl): Don't mark automatic variables
	as static.
	(gfc_build_dummy_array_decl): Handle arrays with unknown element size.
	(gfc_create_string_length): New function.
	(gfc_get_symbol_decl): Create lengths for character variables.
	(gfc_get_fake_result_decl): Ditto.
	(gfc_build_function_decl): Only set length for assumed length
	character arguments.
	(gfc_trans_dummy_character): New function.
	(gfc_trans_auto_character_variable): Rewrite.
	(gfc_trans_deferred_vars): Handle more types of character variable.
	(gfc_create_module_variable): String lengths have moved.
	(gfc_generate_function_code): Initialize deferred var chain earlier.
	* trans-expr.c (gfc_conv_init_string_length): Rename ...
	(gfc_trans_init_string_length):  ... to this.
	(gfc_conv_component_ref, gfc_conv_variable, gfc_conv_concat_op,
	gfc_conv_function_call): Update to new format for character variables.
	(gfc_conv_string_length): Remove.
	(gfc_conv_string_parameter): Update assertion.
	* trans-intrinsic.c (gfc_conv_intrinsic_len): Use new location.
	* trans-io.c (set_string): Use new macro names.
	* trans-stmt.c (gfc_trans_label_assign. gfc_trans_goto): Ditto.
	* trans-types.c (gfc_get_character_type): Use existing length expr.
	(gfc_is_nodesc_array): Make public.
	(gfc_get_dtype_cst): Rename ...
	(gfc_get_dtype): ... to this.  Handle unknown size arrays.
	(gfc_get_nodesc_array_type): Use new name.
	(gfc_sym_type): New character variable code.
	(gfc_get_derived_type): Ditto.
	(gfc_get_function_type): Evaluate character variable lengths.
	* trans-types.h (gfc_strlen_kind): Define.
	(gfc_is_nodesc_array): Add prototype.
	* trans.h: Update prototypes.
	(struct lang_type): Update comments.
	(GFC_DECL_STRING_LEN): New name for GFC_DECL_STRING_LENGTH.
	(GFC_KNOWN_SIZE_STRING_TYPE): Remove.
	testsuite
	* gfortran.fortran-torture/execute/strarray_1.f90: New test.
	* gfortran.fortran-torture/execute/strarray_2.f90: New test.
	* gfortran.fortran-torture/execute/strarray_3.f90: New test.
	* gfortran.fortran-torture/execute/strarray_4.f90: New test.
	* gfortran.fortran-torture/execute/strcommon_1.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.130&r2=1.1.2.131
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/f95-lang.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.18&r2=1.1.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.11&r2=1.1.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-array.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.18&r2=1.1.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-common.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.4&r2=1.1.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-const.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.5&r2=1.1.2.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-const.h.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.3&r2=1.1.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-decl.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.34&r2=1.1.2.35
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-expr.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.20&r2=1.1.2.21
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-intrinsic.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.26&r2=1.1.2.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-io.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.8&r2=1.1.2.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-stmt.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.15&r2=1.1.2.16
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-types.c.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.13&r2=1.1.2.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-types.h.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.2&r2=1.1.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans.h.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.14&r2=1.1.2.15
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.tree-ssa.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=1.1.2.213&r2=1.1.2.214
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/strarray_1.f90.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/strarray_2.f90.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/strarray_3.f90.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/strarray_4.f90.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.fortran-torture/execute/strcommon_1.f90.diff?cvsroot=gcc&only_with_tag=tree-ssa-20020619-branch&r1=NONE&r2=1.1.2.1

Comment 6 Elliot Lee 2004-08-12 21:01:01 UTC
FWIW this is still happening with gcj-3.4.1-20040714
Comment 7 Tom Tromey 2007-01-09 20:45:59 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.
Thanks.