This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFA: fix PR java/18741
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 01 Dec 2004 15:08:40 -0700
- Subject: Patch: RFA: fix PR java/18741
- Reply-to: tromey at redhat dot com
This fixes PR java/18741, a regression.
This looks like fallout from the mapped location change, but I am not
completely positive.
In any case, what is happening is that we are passing a VAR_DECL to
SET_EXPR_LOCATION, where it is only valid to pass `tcc_expr' trees.
This patch changes the code to skip this call for any wrapped tree
that is not an expr. (My understanding is that
EXPR_WITH_FILE_LOCATION can wrap any tree, not just expressions, so
the bug is not in the code creating this tree.)
Ok?
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
PR java/18741:
* java-gimplify.c (java_gimplify_expr): Don't call
SET_EXPR_LOCATION unless wrapped tree is an expression.
Index: java-gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-gimplify.c,v
retrieving revision 1.17
diff -u -r1.17 java-gimplify.c
--- java-gimplify.c 24 Nov 2004 11:41:38 -0000 1.17
+++ java-gimplify.c 1 Dec 2004 21:55:54 -0000
@@ -78,7 +78,8 @@
input_location.line = EXPR_WFL_LINENO (*expr_p);
#endif
*expr_p = EXPR_WFL_NODE (*expr_p);
- SET_EXPR_LOCATION (*expr_p, input_location);
+ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (*expr_p))))
+ SET_EXPR_LOCATION (*expr_p, input_location);
break;
case LABELED_BLOCK_EXPR: