This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: fix handling of 'long'
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 10 Oct 2005 13:57:54 -0600
- Subject: [gcjx] Patch: FYI: fix handling of 'long'
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
This fixes how literals of type 'long' are turned into trees.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* tree.cc (build_long): Rewrote.
Index: tree.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.cc,v
retrieving revision 1.1.2.55
diff -u -r1.1.2.55 tree.cc
--- tree.cc 10 Oct 2005 19:54:11 -0000 1.1.2.55
+++ tree.cc 10 Oct 2005 20:03:46 -0000
@@ -2414,8 +2414,15 @@
tree
tree_generator::build_long (jlong val)
{
- // FIXME: what if HOST_WIDE_INT is smaller than jlong?
- return build_int_cst (type_jlong, val);
+ unsigned HOST_WIDE_INT low;
+ HOST_WIDE_INT high;
+ unsigned HOST_WIDE_INT v2;
+
+ v2 = (unsigned HOST_WIDE_INT) ((val >> 32) & 0xffffffffLL);
+ lshift_double (v2, 0, 32, 64, &low, &high, 0);
+ add_double (low, high, (unsigned HOST_WIDE_INT) (val & 0xffffffffLL),
+ 0, &low, &high);
+ tree value = build_int_cst_wide (type_jlong, low, high);
}
tree