aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/decl.c
diff options
context:
space:
mode:
authorAnthony Green <green@cygnus.com>2000-03-08 03:10:19 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-03-07 19:10:19 -0800
commit3fc61836514d0f883c45a4a05ed79fb7a7eeb1e8 (patch)
tree611e0667ea742030635f065587396e03b8124ea3 /gcc/java/decl.c
parentcd7c5840050a985008c4ecc37236dde3c9dc6d28 (diff)
downloadgcc-3fc61836514d0f883c45a4a05ed79fb7a7eeb1e8.zip
gcc-3fc61836514d0f883c45a4a05ed79fb7a7eeb1e8.tar.gz
gcc-3fc61836514d0f883c45a4a05ed79fb7a7eeb1e8.tar.bz2
re GNATS gcj/107 (Bad array or type conversion bug when compiling bytecode)
1999-11-28 Anthony Green <green@cygnus.com> * decl.c (find_local_variable): Reuse single slot decls when appropriate. (This fixes the Java PR #107: http://sourceware.cygnus.com/ml/java-prs/1999-q4/msg00171.html) From-SVN: r32398
Diffstat (limited to 'gcc/java/decl.c')
-rw-r--r--gcc/java/decl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index 13d2dd7..3aea820 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -136,9 +136,7 @@ push_jvm_slot (index, decl)
/* Find a VAR_DECL (or PARM_DECL) at local index INDEX that has type TYPE,
that is valid at PC (or -1 if any pc).
- If there is no existing matching decl, allocate one.
- If we find a decl with matching modes but different types,
- we re-use the rtl, but create a new decl. */
+ If there is no existing matching decl, allocate one. */
tree
find_local_variable (index, type, pc)
@@ -148,6 +146,7 @@ find_local_variable (index, type, pc)
{
tree decl = TREE_VEC_ELT (decl_map, index);
tree best = NULL_TREE;
+
while (decl != NULL_TREE)
{
int in_range;
@@ -156,6 +155,10 @@ find_local_variable (index, type, pc)
&& pc < DECL_LOCAL_END_PC (decl));
if ((TREE_TYPE (decl) == type
+ || (TREE_CODE (TREE_TYPE (decl)) == TREE_CODE (type)
+ && TYPE_PRECISION (TREE_TYPE (decl)) <= 32
+ && TYPE_PRECISION (type) <= 32
+ && TREE_CODE (type) != POINTER_TYPE)
|| (TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE
&& type == ptr_type_node))
&& in_range)