This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Updated: RFA: partially hookize POINTER_SIZE
- From: Tom Tromey <tromey at redhat dot com>
- To: Joern Rennecke <amylaar at spamcop dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 28 Jun 2011 13:01:59 -0600
- Subject: Re: Updated: RFA: partially hookize POINTER_SIZE
- References: <20101129070117.ar5qwmbkg840ws4o-nzlynne@webmail.spamcop.net> <20110626080845.bgietnj74scswoog-nzlynne@webmail.spamcop.net>
>>>>> "Joern" == Joern Rennecke <amylaar@spamcop.net> writes:
Joern> This is basically the same patch as posted before in
Joern> http://gcc.gnu.org/ml/gcc-patches/2010-11/msg02772.html and updated in
Joern> http://gcc.gnu.org/viewcvs?view=revision&revision=168273, but with a
Joern> few merge conflicts in current mainline resolved.
Joern> * java-tree.h (JAVA_POINTER_SIZE): Define.
Joern> * class.c (make_class_data): Use JAVA_POINTER_SIZE.
Joern> (emit_register_classes): Likewise.
Joern> * jcf-parse.c (handle_long_constant): Likewise.
Joern> * constants.c (build_constants_constructor): Likewise.
Joern> * builtins.c (UNMARSHAL3, UNMARSHAL4, UNMARSHAL5): Likewise.
Joern> (compareAndSwapObject_builtin): Likewise.
Joern> * boehm.c (get_boehm_type_descriptor): Likewise.
Joern> (mark_reference_fields): Add log2_size parameter. Changed all callers.
Joern> gcc/cp:
One question about the Java parts...
Joern> - if (offset % (HOST_WIDE_INT) (POINTER_SIZE / BITS_PER_UNIT))
Joern> + if (offset & ((1 << log2_size) - 1))
I think this has to be '(((HOST_WIDE_INT) 1) << log2_size) - 1'.
Otherwise it seems like this could overflow.
The rest of the java parts are ok.
Tom