class.c (build_static_field_ref): Add a NOP_EXPR; otherwise we get internal error...
authorPer Bothner <per@bothner.com>
Thu, 8 Jul 2004 02:47:08 +0000 (19:47 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Thu, 8 Jul 2004 02:47:08 +0000 (19:47 -0700)
* class.c (build_static_field_ref):  Add a NOP_EXPR; otherwise we
get internal error due to mismatched types.

From-SVN: r84256

gcc/java/ChangeLog
gcc/java/class.c

index 01c337cf8d028236bb8f9d766c9380828af6af91..b805bf2bda61c528220c491a239411019ef0c443 100644 (file)
@@ -1,5 +1,8 @@
 2004-07-07  Per Bothner  <per@bothner.com>
 
+       * class.c (build_static_field_ref):  Add a NOP_EXPR; otherwise we
+       get internal error due to mismatched types.
+
        * gcj.texi (Invoking gij):  Document new -verbose:class flag.
 
        * gcj.texi (Linking):   New node.  Document -lgij usage.
index 48f6b8609cab68b58316ac1c5b8ce5c4f1a1ca2b..5e7c2b9422b69d2f29157a82b03aa58411614ad2 100644 (file)
@@ -1126,6 +1126,7 @@ build_static_field_ref (tree fdecl)
       ref = build (COMPONENT_REF, ptr_type_node,
                   ref, TREE_CHAIN (TYPE_FIELDS (field_info_union_node)),
                   NULL_TREE);
+      ref = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (fdecl)), ref);
       return fold (build1 (INDIRECT_REF, TREE_TYPE(fdecl), ref));
     }
 }