https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99989

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #4)
> So perhaps just:
> --- gcc/gimple-ssa-warn-alloca.c.jj   2021-01-04 10:25:38.892233156 +0100
> +++ gcc/gimple-ssa-warn-alloca.c      2021-04-09 12:46:27.466847728 +0200
> @@ -124,9 +124,8 @@ public:
>    alloca_type_and_limit (enum alloca_type type,
>                        wide_int i) : type(type), limit(i) { }
>    alloca_type_and_limit (enum alloca_type type) : type(type)
> -  { if (type == ALLOCA_BOUND_MAYBE_LARGE
> -     || type == ALLOCA_BOUND_DEFINITELY_LARGE)
> -      limit = wi::to_wide (integer_zero_node);
> +  {
> +    limit = wi::to_wide (integer_zero_node);
>    }
>  };
>  
> in this case?  Explicitly trying to have limit member conditionally
> uninitialized  seems like a bad idea to me.

Yes, that looks good - the existing code is definitely odd, but maybe Martin
can clarify.

Reply via email to