http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48819

--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-04-29 
10:44:54 UTC ---
Issues may arise if build_int_cst is called with NULL_TREE and the value
is using all HOST_WIDE_INT bits (I suppose 64 on sparc-sun-solaris2?) but
integer_type_node has less precision.

Java maintainers, please go over build_int_cst (NULL_TREE, ...) users
and replace NULL_TREE with an appropriate type.  Using size_int (...)
might be a good idea in some places (wtf get_tag_node ...).

I'm not sure what _CD_ArrayStore is.

If the patch helps the following should point to the bug in the Java frontend:

Index: tree.c
===================================================================
--- tree.c      (revision 173151)
+++ tree.c      (working copy)
@@ -1019,7 +1019,12 @@ build_int_cst (tree type, HOST_WIDE_INT
 {
   /* Support legacy code.  */
   if (!type)
-    type = integer_type_node;
+    {
+      double_int a = shwi_to_double_int (low);
+      double_int b = double_int_sext (a, TYPE_PRECISION (integer_type_node));
+      gcc_assert (double_int_equal_p (a, b));
+      return build_int_cst_wide (integer_type_node, low, low < 0 ? -1 : 0);
+    }

   return double_int_to_tree (type, shwi_to_double_int (low));
 }

Reply via email to