aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2002-04-22 16:55:39 +0000
committerAndrew Haley <aph@gcc.gnu.org>2002-04-22 16:55:39 +0000
commita2761d68260d30936bae7d598a6055cf5dead60b (patch)
tree13ebed8b94cdb76ebae4e89858eb16469cce9931 /gcc/java
parent0a528c61ffcb1cc7bc7057b18268745bdd5eb37f (diff)
downloadgcc-a2761d68260d30936bae7d598a6055cf5dead60b.zip
gcc-a2761d68260d30936bae7d598a6055cf5dead60b.tar.gz
gcc-a2761d68260d30936bae7d598a6055cf5dead60b.tar.bz2
jcf-write.c (push_long_const): lo, hi: New variables.
2002-04-19 Andrew Haley <aph@redhat.com> * jcf-write.c (push_long_const): lo, hi: New variables. Use rshift_double to extract the high part of a 64-bit long. Use WORD_TO_INT to extract the low part. * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned HOST_WIDE_INT for num. Use JPOOL_UINT to get it. CONSTANT_Double: Use JPOOL_UINT to get both halve of a double. From-SVN: r52618
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog10
-rw-r--r--gcc/java/jcf-parse.c8
-rw-r--r--gcc/java/jcf-write.c15
3 files changed, 24 insertions, 9 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 48884bb..da51e18 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,13 @@
+2002-04-19 Andrew Haley <aph@redhat.com>
+
+ * jcf-write.c (push_long_const): lo, hi: New variables.
+ Use rshift_double to extract the high part of a 64-bit long.
+ Use WORD_TO_INT to extract the low part.
+
+ * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned
+ HOST_WIDE_INT for num. Use JPOOL_UINT to get it.
+ CONSTANT_Double: Use JPOOL_UINT to get both halve of a double.
+
2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
* typeck.c (incomplete_type_error): Remove.
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 53e647c..cbf5ac9 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -292,10 +292,10 @@ get_constant (jcf, index)
}
case CONSTANT_Long:
{
- jint num = JPOOL_INT (jcf, index);
+ unsigned HOST_WIDE_INT num = JPOOL_UINT (jcf, index);
HOST_WIDE_INT lo, hi;
lshift_double (num, 0, 32, 64, &lo, &hi, 0);
- num = JPOOL_INT (jcf, index+1) & 0xffffffff;
+ num = JPOOL_UINT (jcf, index+1);
add_double (lo, hi, num, 0, &lo, &hi);
value = build_int_2 (lo, hi);
TREE_TYPE (value) = long_type_node;
@@ -316,9 +316,9 @@ get_constant (jcf, index)
HOST_WIDE_INT num[2];
REAL_VALUE_TYPE d;
HOST_WIDE_INT lo, hi;
- num[0] = JPOOL_INT (jcf, index);
+ num[0] = JPOOL_UINT (jcf, index);
lshift_double (num[0], 0, 32, 64, &lo, &hi, 0);
- num[0] = JPOOL_INT (jcf, index+1);
+ num[0] = JPOOL_UINT (jcf, index+1);
add_double (lo, hi, num[0], 0, &lo, &hi);
/* Since ereal_from_double expects an array of HOST_WIDE_INT
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 215d0c5..2988c47 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -853,15 +853,20 @@ push_long_const (lo, hi, state)
HOST_WIDE_INT lo, hi;
struct jcf_partial *state;
{
- if (hi == 0 && lo >= 0 && lo <= 1)
+ HOST_WIDE_INT highpart, dummy;
+ jint lowpart = WORD_TO_INT (lo);
+
+ rshift_double (lo, hi, 32, 64, &highpart, &dummy, 1);
+
+ if (highpart == 0 && (lowpart == 0 || lowpart == 1))
{
RESERVE(1);
- OP1(OPCODE_lconst_0 + lo);
+ OP1(OPCODE_lconst_0 + lowpart);
}
- else if ((hi == 0 && (jword)(lo & 0xFFFFFFFF) < 32768)
- || (hi == -1 && (lo & 0xFFFFFFFF) >= (jword)-32768))
+ else if ((highpart == 0 && lowpart > 0 && lowpart < 32768)
+ || (highpart == -1 && lowpart < 0 && lowpart >= -32768))
{
- push_int_const (lo, state);
+ push_int_const (lowpart, state);
RESERVE (1);
OP1 (OPCODE_i2l);
}