This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Widen field offset
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Date: Wed, 28 Jan 2004 16:37:04 +0000
- Subject: Widen field offset
A thinko of mine in the Java front end.
A question: when I add a pointer and an integer, I need to widen the
integer to be the same size as the pointer. Is it correct to do this
by converting the integer to another pointer of the same type, or must
I convert the integer to an integer type of the same size as a
pointer?
Andrew.
2004-01-28 Andrew Haley <aph@redhat.com>
* expr.c (build_field_ref): Widen field offset.
Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.181
diff -c -2 -p -r1.181 expr.c
*** expr.c 9 Jan 2004 19:55:12 -0000 1.181
--- expr.c 28 Jan 2004 15:09:15 -0000
*************** build_field_ref (tree self_value, tree s
*** 1524,1527 ****
--- 1543,1547 ----
build (ARRAY_REF, integer_type_node, TYPE_OTABLE_DECL (output_class),
otable_index);
+ field_offset = fold (convert (ptr_type_node, field_offset));
tree address
= fold (build (PLUS_EXPR,