On Fri, Feb 17, 2023 at 10:26:03PM +0000, Qing Zhao via Gcc-patches wrote:
> +           else if (!DECL_NAME (lhs_var))
> +             {
> +               char *lhs_var_name_str
> +                 = xasprintf ("D.%u", DECL_UID (lhs_var));

Why xasprintf?  D.%u can be sprintfed into a fixed size automatic buffer,
say 3 + (HOST_BITS_PER_INT + 2) / 3 would be a good upper bound for the size
of the buffer.  Then you don't need to free it...

> +               if (strcmp (lhs_var_name_str, var_name_str) == 0)
> +                 {
> +                   free (lhs_var_name_str);
> +                   return;
> +                 }
> +               free (lhs_var_name_str);
> +             }
> +         }
>         gcc_assert (var_name_str && var_def_stmt);
>       }
>      }
> -- 
> 2.31.1

        Jakub

Reply via email to