[v2 0/9] RFC: port gas to use libiberty htab hash table

Martin Liška mliska@suse.cz
Thu Aug 20 07:16:09 GMT 2020


On 8/20/20 3:36 AM, Alan Modra wrote:
> On Wed, Aug 19, 2020 at 10:28:47AM +0200, Martin Liska wrote:
>> Hello.
>>
>> There's second version of the patch set where I did:
>> - New htab_t related functions are implemented in gas/hash.c, libiberty
>>    maintainer was not happy about moving them to libiberty.
>> - New str_hash_* function were added to support a string hash table
>>    based on htab_t.
>> - Legacy hash table is removed in gas/hash.[ch]
>> - Two related options are removed (--reduce-memory-overheads, --hash-size arguments)
>>
>> I tested the patchset on all targets.
>> Thoughts?
> 
> Excellent.  There was one small problem when compiling for a 32-bit
> host:
> /home/alan/src/binutils-gdb/gas/hash.c: In function ‘htab_print_statistics’:
> /home/alan/src/binutils-gdb/gas/hash.c:53:20: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t {aka unsigned int}’ [-Werror=format=]
>     fprintf (f, "\t%lu elements\n", htab_elements (table));
>                    ~~^              ~~~~~~~~~~~~~~~~~~~~~
>                    %u
> /home/alan/src/binutils-gdb/gas/hash.c:54:20: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘size_t {aka unsigned int}’ [-Werror=format=]
>     fprintf (f, "\t%lu table size\n", htab_size (table));
>                    ~~^                ~~~~~~~~~~~~~~~~~
>                    %u
> 
> I fixed that, and decided I'd rather see the raw collision count than
> a ratio so changed that too.  There was also some commentary that is
> no longer relevant in hash.c, and ChangeLog entries in gas/ChangeLog
> shouldn't have leading "gas/" path names.  And an extra hashtab.h in
> as.h.  Committed, thanks very much!

Hey.

Thank you very much for the application of the patch set.
It helped the original motivation test-case by 30%. That's
nice result.

Martin



More information about the Binutils mailing list