This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: Java: Fix PR 8618
- From: Andreas Tobler <toa at pop dot agri dot ch>
- 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
- Date: Sat, 10 Jul 2004 09:28:07 +0200
- Subject: Re: Patch: Java: Fix PR 8618
- References: <40EF67C7.3030504@redhat.com>
Hi Bryce,
this one breaks bootstrap. (at least here on darwin)
Bryce McKinlay wrote:
int
common_enclosing_context_p (tree type1, tree type2)
{
+ for (type1; type1; <----------- here
+ type1 = (INNER_CLASS_TYPE_P (type1) ?
+ TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type1))) : NULL_TREE))
+ {
+ tree current;
+ for (current = type2; current;
+ current = (INNER_CLASS_TYPE_P (current) ?
+ TREE_TYPE (DECL_CONTEXT (TYPE_NAME (current))) :
+ NULL_TREE))
+ if (type1 == current)
+ return 1;
+ }
+ return 0;
+}
I get a warning with 'statement with no effect on class.c:597'
Is this the right approach?
I continue and see if I did some rubbish ;)
Andreas
Index: java/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.197
diff -u -r1.197 class.c
--- java/class.c 10 Jul 2004 05:38:15 -0000 1.197
+++ java/class.c 10 Jul 2004 07:16:16 -0000
@@ -594,16 +594,17 @@
int
common_enclosing_context_p (tree type1, tree type2)
{
- for (type1; type1;
- type1 = (INNER_CLASS_TYPE_P (type1) ?
- TREE_TYPE (DECL_CONTEXT (TYPE_NAME (type1))) : NULL_TREE))
+ tree first;
+ for (first = type1; first;
+ first = (INNER_CLASS_TYPE_P (first) ?
+ TREE_TYPE (DECL_CONTEXT (TYPE_NAME (first))) : NULL_TREE))
{
tree current;
for (current = type2; current;
current = (INNER_CLASS_TYPE_P (current) ?
TREE_TYPE (DECL_CONTEXT (TYPE_NAME (current))) :
NULL_TREE))
- if (type1 == current)
+ if (first == current)
return 1;
}
return 0;