This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: Fix PR 23891 / Eclipse bootstrap
- From: Andrew Haley <aph at redhat dot com>
- To: Bryce McKinlay <mckinlay at redhat dot com>
- Cc: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Andrew Overholt <overholt at redhat dot com>
- Date: Thu, 15 Sep 2005 15:04:41 +0100
- Subject: Re: Patch: Fix PR 23891 / Eclipse bootstrap
- References: <4328C735.9020200@redhat.com>
Bryce McKinlay writes:
> Bootstrapping of gcj-compiled native Eclipse, which uses gcj to build
> Eclipse's own bytecode compiler, ecj, broke recently on both HEAD and
> the 4.0 branch.
>
> The problem is that when folding constants which depend on other
> constants, the current_class context is pushed, but the package context
> (cxtp->context) is not, so it attempts to resolve using the wrong
> package. This regression was introduced (and subsequently backported to
> the 4.0 branch) with the fix for java/17845. Although that patch itself
> is correct, it exposed this problem by removing a (bogus) fallback case
> where gcj would search in all known packages for a class definition.
>
> This patch fixes the problem by introducing a TYPE_PACKAGE lang
> specific field, and changing do_resolve_class so that the package is
> determined based on current_class and not ctxp->package which may not be
> valid except during parsing. Adding TYPE_PACKAGE also allows other parts
> of the compiler to be simplified, eg class_in_current_package().
>
> No libjava testsuite regressions, and ecj now builds. However, currently
> I see the following changes in JACKS results with this patch applied:
>
> FAIL: 15.9.1-qualified-concrete-24
> XPASS: 15.12.2.1-accessibility-method-2
> FAIL: 15.12.2.1-accessibility-method-3
> XPASS: 15.12.2.1-accessibility-method-4
> FAIL: 15.12.2.1-accessibility-method-5
>
> These are cross-package hidden member visibility tests. They seem to be
> cases that we "accidentally" passed or failed for the wrong reasons
> previously. Even if they compiled before, the code generated was
> unlikely to be correct. I think that given the need for this patch to
> get Eclipse working again, they can be addressed in a follow up patch.
Sigh. I guess we'll live with that.
> 2005-09-14 Bryce McKinlay <mckinlay@redhat.com>
>
> PR java/23891
> * parse.y (maybe_create_class_interface_decl): Set TYPE_PACKAGE for
> the newly created type. Set import lists here, not in create_class.
> (jdep_resolve_class): Set current_class.
> (do_resolve_class): Use current_class's TYPE_PACKAGE to determine
> the current package context, not ctxp->package.
> (cicp_cache): Removed.
> (class_in_current_package): Simplify implementation using TYPE_PACKAGE.
> * jcf-parse.c (give_name_to_class): Set TYPE_PACKAGE.
> * java-tree.h (TYPE_PACKAGE): New macro.
> (struct lang_type): New member 'package'.
OK.
Andrew.