From 07c6ee1bd95bb3b64c7b1c0d4acc94d0c5627340 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 20 Aug 2004 09:13:12 +0000 Subject: [PATCH] expr.c (build_java_arrayaccess): Use convert to change len's type. * expr.c (build_java_arrayaccess): Use convert to change len's type. From-SVN: r86307 --- gcc/java/ChangeLog | 7 ++++++- gcc/java/expr.c | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index b16f9f35252..5af0be7ecec 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2004-08-20 Nathan Sidwell + + * expr.c (build_java_arrayaccess): Use convert to change + len's type. + 2004-08-19 Bryce McKinlay * class.c (make_local_function_alias): Allocate extra space for 'L' @@ -8587,7 +8592,7 @@ properly initialize `finished_label'. Don't emit gotos for empty try statements. -2000-03-19 Martin v. Löwis +2000-03-19 Martin v. Löwis * except.c (emit_handlers): Clear catch_clauses_last. diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 9472794dfee..97f540aac16 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -763,8 +763,8 @@ build_java_arrayaccess (tree array, tree type, tree index) * Note this is equivalent to and more efficient than: * INDEX < 0 || INDEX >= LEN && throw ... */ tree test; - tree len = build_java_array_length_access (array); - TREE_TYPE (len) = unsigned_int_type_node; + tree len = convert (unsigned_int_type_node, + build_java_array_length_access (array)); test = fold (build2 (GE_EXPR, boolean_type_node, convert (unsigned_int_type_node, index), len)); -- 2.30.2