This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Java definite assignment
- To: gcc-patches at gcc dot gnu dot org
- Subject: [patch] Java definite assignment
- From: Per Bothner <per at bothner dot com>
- Date: 05 Feb 2001 17:43:54 -0800
- Cc: java at gcc dot gnu dot org
Without this patch gcj complains that
"Variable `xx' may not have been initialized":
int xx;
for (;;) {
if (b) { xx = ...; break }
....
}
use(xx);
This does seem like the correct fix, but I haven't tested it seriously.
Could someone try applying it before their next build and testsuite-run?
* check-init.c (check_init): Don't call done_alternative after
processing loop code, as a LOOP_EXPR never terminates normally.
Index: check-init.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/check-init.c,v
retrieving revision 1.26
diff -u -r1.26 check-init.c
--- check-init.c 2001/02/04 22:44:02 1.26
+++ check-init.c 2001/02/06 01:25:05
@@ -451,7 +451,6 @@
BEGIN_ALTERNATIVES (before, alt);
alt.block = exp;
check_init (TREE_OPERAND (exp, 0), before);
- done_alternative (before, &alt);
END_ALTERNATIVES (before, alt);
return;
}
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/