This is the mail archive of the
mailing list for the GCC project.
Re: [Bug middle-end/37448] patch to compute alloc-pool stats correctly
- From: Kenneth Zadeck <zadeck at naturalbridge dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: "Hubicha\, Jan" <jh at suse dot cz>, Richard Guenther <richard dot guenther at gmail dot com>, Daniel Berlin <dberlin at dberlin dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 07 Oct 2008 12:33:47 -0400
- Subject: Re: [Bug middle-end/37448] patch to compute alloc-pool stats correctly
- References: <48DD5BBE.firstname.lastname@example.org> <email@example.com>
Ian Lance Taylor wrote:
> Kenneth Zadeck <firstname.lastname@example.org> writes:
>> 2008-09-26 Kenneth Zadeck <email@example.com>
>> PR rtl-optimization/37448
>> alloc_pool_desc (elt_size): New field.
>> alloc-pool.c (create_alloc_pool, empty_alloc_pool, pool_alloc,
>> pool_free): Properly keep track of desc->size.
>> (print_statistics, dump_alloc_pool_statistics): Enhance the
>> printing of statistics to print the number of elements.
>> -/* Store information about each particular alloc_pool. */
>> +/* Store information about each particular alloc_pool. Note that this
>> + will underestimate the amount the amount of storage used by a small amount:
>> + 1) The overhead in a pool is not accounted for.
>> + 2) The unallocated elements in a block are not accounted for. Note
>> + that this can at worst case be one element smaller that the block
>> + size for that pool.
> Please put the */ at the end of the previous line.
> I wonder if some of the types in alloc_pool_descriptor should be
> size_t rather than int, though it's hard to imagine it making a
> difference in real life.
I noticed this too, it actually does make a difference in the printing
of the values on the testcase since they overflow. However, I did not
know how to modify the formats in the printfs to print the size_ts.
> OK with that change.