[proposed but not yet applied fix for a typo in the Java FE ] Date: Thu, 11 Oct 2012 23:13:21 -0700 From: Andrew Haley Subject: Re: possible typo in gcc/java/expr.c at line 1053 List-Archive: On 10/11/2012 06:59 PM, Kenneth Zadeck wrote: > this code looks bogus, i think that the "== INTEGER_CST" needs to disappear. > > tree > build_newarray (int atype_value, tree length) > { > tree type_arg; > > tree prim_type = decode_newarray_type (atype_value); > tree type > = build_java_array_type (prim_type, > host_integerp (length, 0) == INTEGER_CST > ? tree_low_cst (length, 0) : -1); > Thanks, you're right. This bug was introduced by Kenner in March 2000! Andrew. --- gcc-4.8.0/gcc/java/expr.c.~1~ 2013-01-10 21:38:27.000000000 +0100 +++ gcc-4.8.0/gcc/java/expr.c 2013-03-23 17:54:58.464006900 +0100 @@ -1049,7 +1049,7 @@ build_newarray (int atype_value, tree le tree prim_type = decode_newarray_type (atype_value); tree type = build_java_array_type (prim_type, - host_integerp (length, 0) == INTEGER_CST + host_integerp (length, 0) ? tree_low_cst (length, 0) : -1); /* Pass a reference to the primitive type class and save the runtime