This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: fix tree check failure in gcj


This code, from Jacks, causes a tree-checking failure in gcj.

    public class T52n1 {
	public static void main(String[] args) {

	    final int i = 1;
	    byte b = i;

	}
    }

The appended patch fixes this.
Ok?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* parse.y (try_builtin_assignconv): Don't pass a VAR_DECL to
	int_fits_type_p.

	* check-init.c (check_init): Don't allow pre- or post- increment
	or decrement of final variable.
	(final_assign_error): Minor error message rewording.

Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.331
diff -u -r1.331 parse.y
--- parse.y 2001/12/06 23:12:55 1.331
+++ parse.y 2001/12/09 06:29:32
@@ -12782,7 +12782,7 @@
 	   && (lhs_type == byte_type_node || lhs_type == char_type_node
 	       || lhs_type == short_type_node))
     {
-      if (int_fits_type_p (rhs, lhs_type))
+      if (int_fits_type_p (DECL_INITIAL (rhs), lhs_type))
         new_rhs = convert (lhs_type, rhs);
       else if (wfl_op1)		/* Might be called with a NULL */
 	parse_warning_context 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]