This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
TYPE_ALIGN? Re: Java: hashtable synchronization for PowerPC
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: apbianco at redhat dot com
- Cc: "Boehm, Hans" <hans_boehm at hp dot com>, gcc at gcc dot gnu dot org
- Date: Wed, 06 Mar 2002 11:07:52 +1300
- Subject: TYPE_ALIGN? Re: Java: hashtable synchronization for PowerPC
- References: <40700B4C02ABD5119F000090278766443BF040@hplex1.hpl.hp.com> <15493.15295.850054.269654@ryobi.cygnus.com>
Alexandre Petit-Bianco wrote:
>Boehm, Hans writes:
>
>>If I understand what this is doing, you really want alignment = 8 *
>>smallest_addressable_unit, i.e. 8 bytes, even on a 64 bit machine.
>>Does this do that?
>>
>
>I read the comment and went with the `at least double-word' alignment.
>
>On x86, this would be (BITS_PER_UNIT = 8) * (UNITS_PER_WORD = 4) *
>(double = 2), 64.
>
Sorry, the comment is inaccurate - it should say "at least 64-bit
alignment". The only reason why it checks (POINTER_SIZE < 64) is that I
wanted to make sure we didn't end up _reducing_ alignment if the back
end wants > 64-bit alignment, but I don't know if there is a way to find
out what the natural alignment for the structure according to the back
end is from the front-end.
But now I think about it, TYPE_ALIGN is presumably only treated as a
minimum alignment - the back end would still override this with a
greater alignment if it wante to, right?
So how about:
RCS file: /cvs/gcc/egcs/gcc/java/decl.c,v
...
+
+ /* Hash synchronization requires at least 64-bit alignment. */
+ if (flag_hash_synchronization)
+ TYPE_ALIGN (class_type_node) = 64;
regards
Bryce.