java/5942: tree check failure when compiling Classpath with strictfp StrictMath class

mark@klomp.org mark@klomp.org
Wed Mar 13 11:36:00 GMT 2002


>Number:         5942
>Category:       java
>Synopsis:       tree check failure when compiling Classpath with strictfp StrictMath class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 13 11:36:04 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     mark@klomp.org
>Release:        gcc version 3.1 20020313 (prerelease)
>Organization:
>Environment:
Debian GNU/Linux (sid/unstable)
>Description:
Compiling a recent Classpath from CVS gives:

/usr/local/gcc-3.1/bin/gcj -C -d . @classes
./../java/security/Identity.java:207: tree check: expected class 't', have 'e' (expr_with_file_location) in unresolved_type_p, at java/parse.y:5028

This problem goes away when you remove the strictfp class modifier from java/lang/StrictMath.java.

(Note that you will soon hit bug #4715 - Tree check failure in check_inner_circular_reference, without the patch in that bug report.)
>How-To-Repeat:
Get either the latest CVS version of GNU Classpath or the latest release (0.0.3). (The latest release does not contain StrictMath yet but adding the strictfp class modifier to java/lang/Math.java gives the same results.)

./configure --with-gjc
make
>Fix:
The following horrible kludge seems to work around it.

--- parse.y     2002/03/12 18:07:32     1.353.2.5
+++ parse.y     2002/03/13 01:30:53
@@ -5025,10 +5025,18 @@
       if (returned)
        {
          tree decl = IDENTIFIER_CLASS_VALUE (EXPR_WFL_NODE (wfl));
-         if (decl && current_class && (decl == TYPE_NAME (current_class)))
+         tree cc = current_class;
+         if (cc && TREE_CODE (cc) == EXPR_WITH_FILE_LOCATION)
+           cc = EXPR_WFL_NODE (cc);
+         if (decl && cc && (decl == TYPE_NAME (current_class)))
            *returned = TREE_TYPE (decl);
          else if (GET_CPC_UN () == EXPR_WFL_NODE (wfl))
-           *returned = TREE_TYPE (GET_CPC ());
+         {
+           if (TREE_CODE (GET_CPC ()) != EXPR_WITH_FILE_LOCATION)
+             *returned = TREE_TYPE (GET_CPC ());
+           else
+             *returned = NULL_TREE;
+         }
          else
            *returned = NULL_TREE;
        }
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Java-prs mailing list