This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: RFA: Fix PR java/14853
- From: Andrew Haley <aph at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Mon, 6 Dec 2004 14:22:54 +0000
- Subject: Re: Patch: RFA: Fix PR java/14853
- References: <m3k6rved76.fsf@localhost.localdomain>
Tom Tromey writes:
> This patch fixes PR java/14853, an old regression.
>
> We correctly reject the test code when compiling to .class, but not
> when compiling to .o. In the latter case, we generate trees that the
> definite assignment code does not recognize. In particular a static
> field reference is wrapped in a COMPOUND_EXPR whose LHS initializes
> the target class.
>
> This patch unwraps the COMPOUND_EXPR. I believe this is safe as this
> is the only time we can create a COMPOUND_EXPR wrapping a variable
> reference.
>
> Tested on x86 FC2. Test case included.
>
> Ok?
>
> Tom
>
> Index: gcc/java/ChangeLog
> from Tom Tromey <tromey@redhat.com>
>
> PR java/14853:
> * check-init.c (get_variable_decl): Unwrap COMPOUND_EXPRs.
Eeeeh, OK. This is nasty stuff.
Thanks,
Andrew.