This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFA: fix PR java/17329
- 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: Thu, 23 Sep 2004 11:21:04 +0100
- Subject: Patch: RFA: fix PR java/17329
- References: <m3ekkv5a4f.fsf@localhost.localdomain>
Tom Tromey writes:
> In PR 17329, we are compiling code like this, where Options is a
> different class:
>
> Options.verbose += 2;
>
> This results in a save_expr the _Jv_InitClass call; there is special
> code in gimplify_save_expr() to handle this (searching for "java" in
> this file was enlightening, I had no idea about all these special
> cases).
>
> Anyway, gimplify_save_expr will set the save_expr argument to NULL the
> first time it is seen, but java_gimplify_expr doesn't account for this
> case and crashes.
>
>
> Index: gcc/java/ChangeLog
> from Tom Tromey <tromey@redhat.com>
> PR java/17329:
> * java-gimplify.c (java_gimplify_expr) <SAVE_EXPR>: Ignore case
> where operand is null.
This is fine.
I guess this happens when we generate a SAVE_EXPR with void type. I
wanted to be able to say "is this a variable?" for which
(TREE_CODE (TREE_OPERAND (*expr_p, 0)) == VAR_DECL)
looked fine. But I'd either forgotten, or never knew, that we
{ab}used SAVE_EXPRs with void type.
Andrew.