[PATCH]: Fix PR26734: GCC cannot bootstrap on IA64 HP-UX
Richard Sandiford
richard@codesourcery.com
Tue Mar 21 15:33:00 GMT 2006
Maxim Kuvyrkov <mkuvyrkov@ispras.ru> writes:
> GCC fails to bootstrap at ia64-hpux due to wrong computation of the size
> of DEPS_LIST rtx. Before my patch any rtx could contain either rtunion
> or HOST_WIDE_INT, but not both. DEPS_LIST is defined to hold two
> rtunions and one HOST_WIDE_INT. As it wasn't mentioned among special
> cases of rtx_code_size its size calculated assuming all its fields are
> rtunions. This problem can be fixed by adding DEPS_LIST to the list of
> special cases of rtx_code_size.
Having an rtx that uses both u.fld[] and u.hwint[] fields seems very
unsafe to me.
> As I understand, it is assumed that the size of HOST_WIDE_INT is *not
> less* than the size of void*. If this is not necessarily should be
> true, than rtx_code_size should be fixed in a little bit more tricky way.
No, the assumption is that every rtx either contains all HOST_WIDE_INTs
or all rtunion fields. It shouldn't mix between the two. So...
> @@ -111,7 +111,7 @@ const enum rtx_class rtx_class[NUM_RTX_C
>
> const unsigned char rtx_code_size[NUM_RTX_CODE] = {
> #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) \
> - ((ENUM) == CONST_INT || (ENUM) == CONST_DOUBLE \
> + ((ENUM) == CONST_INT || (ENUM) == CONST_DOUBLE || (ENUM) == DEPS_LIST \
> ? RTX_HDR_SIZE + (sizeof FORMAT - 1) * sizeof (HOST_WIDE_INT) \
> : RTX_HDR_SIZE + (sizeof FORMAT - 1) * sizeof (rtunion)),
...CONST_INT and CONST_DOUBLE are both all-HOST_WIDE_INT fields.
Does the "degree of weakness" really need to be a HOST_WIDE_INT
rather than a plain int?
Richard
More information about the Gcc-patches
mailing list