[gcjx] Definite Assignment Fix
Ranjit Mathew
rmathew@gmail.com
Sat Sep 17 08:25:00 GMT 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
This patch corrects a minor error in variable_state::check_loop()
that was exposed by a couple of Jacks tests. As explained in the
beginning of Chapter 16 of the JLS (page 531 in the JLS3 PDF), we
can conclusively state that an assignment to a variable has occurred
only if it is both definitely assigned and not definitely unassigned.
The method was only checking for the latter.
I found the print() method handy for debugging but it had a couple
of minor problems - it used to print all variables without information
on whether a variable is definitely [un]assigned and it was not a
const method (using const iterators) and was thus ununsable with a
"const variable_state& other". The attached patch also includes a
fix for these.
The net effect of this patch on my Jacks run is:
@@ -48,2 +47,0 @@
-RESULT 16.2.10-definite-unassign-pass-3 FAILED
-RESULT 16.2.11-definite-unassign-pass-3 FAILED
@@ -62 +59,0 @@
-RESULT 16.2.9-definite-unassign-pass-3 FAILED
@@ -252,3 +249,6 @@
-RESULT non-jls-jsr41.4-loop-1 FAILED
-RESULT non-jls-jsr41.4-loop-2 FAILED
-RESULT non-jls-jsr41.4-loop-3 FAILED
+RESULT non-jls-jsr41.4-loop-16 FAILED
+RESULT non-jls-jsr41.4-loop-17 FAILED
+RESULT non-jls-jsr41.4-loop-18 FAILED
+RESULT non-jls-jsr41.4-loop-4 FAILED
+RESULT non-jls-jsr41.4-loop-5 FAILED
+RESULT non-jls-jsr41.4-loop-6 FAILED
The new FAILs are the exposure of a problem with boolean expressions
like "foo && false", which I plan to tackle next.
OK?
Thanks,
Ranjit
- --
Ranjit Mathew Email: rmathew AT gmail DOT com
Bangalore, INDIA. Web: http://ranjitmathew.hostingzero.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDK9MOYb1hx2wRS48RAi2sAKCTqNaU1A+1ZFYSKQLEyue6kUfpegCfQDNl
o6b7KCbeSB2s9dqP/Qt48Ac=
=v+35
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t1.txt
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20050917/c09947dc/attachment.txt>
More information about the Java-patches
mailing list