[PATCH 1/6] aarch64: Drop "" from hint option hash table

Matthieu Longo matthieu.longo@arm.com
Tue Mar 3 16:28:04 GMT 2026


On 03/03/2026 12:38, Alice Carlotti wrote:
> An empty string is the only option where the upper and lower case forms
> are identical, so this allows the upper case insertion logic to be
> simplified as well.
> 
> 
> diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
> index ca9387dcfd8216c3bbfa8fb7bee9fab0aca4dc81..5e92007007310b9f12f1f0051890839216666c17 100644
> --- a/gas/config/tc-aarch64.c
> +++ b/gas/config/tc-aarch64.c
> @@ -10663,15 +10663,15 @@ md_begin (void)
>     for (i = 0; aarch64_hint_options[i].name != NULL; i++)
>       {
>         const char* name = aarch64_hint_options[i].name;
> -      const char* upper_name = get_upper_str(name);
> -
> +      /* Empty strings represent an absent optional operand, so won't be looked
> +	 up in the hash table.  */
> +      if (*name == '\0')
> +	continue;
>         checked_hash_insert (aarch64_hint_opt_hsh, name,
>   			   aarch64_hint_options + i);
> -
> -      /* Also hash the name in the upper case if not the same.  */
> -      if (strcmp (name, upper_name) != 0)
> -	checked_hash_insert (aarch64_hint_opt_hsh, upper_name,
> -			     aarch64_hint_options + i);
> +      /* Also hash the name in the upper case.  */
> +      checked_hash_insert (aarch64_hint_opt_hsh, get_upper_str (name),
> +			   aarch64_hint_options + i);
>       }
>   
>     for (i = 0; aarch64_sys_ins_gic[i].name != NULL; i++)

Looks good to me.

Matthieu


More information about the Binutils mailing list