Commit 3fc61836 by Anthony Green Committed by Alexandre Petit-Bianco

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
parent cd7c5840
...@@ -672,6 +672,11 @@ Tue Nov 30 12:28:34 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> ...@@ -672,6 +672,11 @@ Tue Nov 30 12:28:34 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
check. check.
* expr.c (expand_java_arraystore): Likewise. * expr.c (expand_java_arraystore): Likewise.
1999-11-28 Anthony Green <green@cygnus.com>
* decl.c (find_local_variable): Reuse single slot decls when
appropriate.
Wed Nov 24 17:33:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com> Wed Nov 24 17:33:26 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* jcf-parse.c (saw_java_source): Global variable removed. * jcf-parse.c (saw_java_source): Global variable removed.
......
...@@ -136,9 +136,7 @@ push_jvm_slot (index, decl) ...@@ -136,9 +136,7 @@ push_jvm_slot (index, decl)
/* Find a VAR_DECL (or PARM_DECL) at local index INDEX that has type TYPE, /* 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). that is valid at PC (or -1 if any pc).
If there is no existing matching decl, allocate one. 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. */
tree tree
find_local_variable (index, type, pc) find_local_variable (index, type, pc)
...@@ -148,6 +146,7 @@ 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 decl = TREE_VEC_ELT (decl_map, index);
tree best = NULL_TREE; tree best = NULL_TREE;
while (decl != NULL_TREE) while (decl != NULL_TREE)
{ {
int in_range; int in_range;
...@@ -156,6 +155,10 @@ find_local_variable (index, type, pc) ...@@ -156,6 +155,10 @@ find_local_variable (index, type, pc)
&& pc < DECL_LOCAL_END_PC (decl)); && pc < DECL_LOCAL_END_PC (decl));
if ((TREE_TYPE (decl) == type 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 || (TREE_CODE (TREE_TYPE (decl)) == POINTER_TYPE
&& type == ptr_type_node)) && type == ptr_type_node))
&& in_range) && in_range)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment