On Thu, Oct 06, 2011 at 03:28:02PM -0700, Richard Henderson wrote:
> The layout of trees has been restructured since anyone has tried
> to enable fold checking (or =all checking). One of the types
> referenced, struct tree_type, doesn't exist anymore.
>
> Jakub, I was hoping you could remember exactly what you were
> trying to test for with this assert. It looks terribly arbitrary
> after all this time...
4.3 was using:
struct tree_function_decl buf;
int i, len;
recursive_label:
gcc_assert ((sizeof (struct tree_exp) + 5 * sizeof (tree)
<= sizeof (struct tree_function_decl))
&& sizeof (struct tree_type) <= sizeof (struct
tree_function_decl));
As 4.4+ uses union tree_node buf; instead, I guess the
sizeof (struct tree_type) <= check is pointless.
Currently buf is used just for decls and types, so union tree_node buf
should be big enough for everything, apparently in 3.4
buf was used for decls, types and SAVE_EXPR (which had 3 operands
at that point, dunno if 5 was just tiny bit bigger just in case).
BTW, this is likely PR other/49752.
> --- a/gcc/fold-const.c
> +++ b/gcc/fold-const.c
> @@ -13880,11 +13880,7 @@ fold_checksum_tree (const_tree expr, struct md5_ctx
> *ctx, htab_t ht)
> union tree_node buf;
> int i, len;
>
> -recursive_label:
> -
> - gcc_assert ((sizeof (struct tree_exp) + 5 * sizeof (tree)
> - <= sizeof (struct tree_function_decl))
> - && sizeof (struct tree_type) <= sizeof (struct
> tree_function_decl));
> + recursive_label:
> if (expr == NULL)
> return;
> slot = (void **) htab_find_slot (ht, expr, INSERT);
Jakub