On Wed, Nov 10, 2021 at 12:31:28AM +0530, Siddhesh Poyarekar wrote:
> Put all accesses to object_sizes behind functions so that we can add
> dynamic capability more easily.
> 
> gcc/ChangeLog:
> 
>       * tree-object-size.c (object_sizes_grow, object_sizes_release,
>       object_sizes_unknown_p, object_sizes_get, object_size_set_force,
>       object_sizes_set): New functions.
>       (addr_object_size, compute_builtin_object_size,
>       expr_object_size, call_object_size, unknown_object_size,
>       merge_object_sizes, plus_stmt_object_size,
>       cond_expr_object_size, collect_object_sizes_for,
>       check_for_plus_in_loops_1, init_object_sizes,
>       fini_object_sizes): Adjust.

> @@ -975,8 +994,9 @@ collect_object_sizes_for (struct object_size_info *osi, 
> tree var)
>      {
>        if (bitmap_set_bit (osi->visited, varno))
>       {
> -       object_sizes[object_size_type][varno]
> -         = (object_size_type & 2) ? -1 : 0;
> +       /* Initialize to 0 for maximum size and M1U for minimum size so that
> +          it gets immediately overridden.  */
          object_sizes_set_force (osi, varno, unknown (object_size_type ^ 2));

Shouldn't that be                             unknown (object_size_type
                                                       ^ OST_MINIMUM)
?
Or, if you redo the series, update the first patch so that it doesn't leave
any & 2 or & 1 etc. around and instead uses the enumerators and redo this
patch?

Otherwise LGTM.

        Jakub

Reply via email to