Patchwork [RFC] --enable-checking=fold build failure

login
register
mail settings
Submitter Richard Henderson
Date Oct. 6, 2011, 10:28 p.m.
Message ID <4E8E2B72.6090501@redhat.com>
Download mbox | patch
Permalink /patch/118176/
State New
Headers show

Comments

Richard Henderson - Oct. 6, 2011, 10:28 p.m.
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...


r~
Jakub Jelinek - Oct. 6, 2011, 11:12 p.m.
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

Patch

diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 404d904..7568c6f 100644
--- 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);