This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cpplib: some size reductions


On Thu, Oct 28, 1999 at 01:11:46PM -0700, Zack Weinberg wrote:
> I believe gcc only cares about the absolute number of entries in the
> switch, not the sparseness.  However, it would be easier to read with
> a switch, and it ought to be relatively easy to teach the compiler to
> consider table sparseness too...

No, there's code in there for sparseness.  It's just hard to trigger.

      else if (TREE_INT_CST_HIGH (range) != 0
               || count < (unsigned int) CASE_VALUES_THRESHOLD
               || ((unsigned HOST_WIDE_INT) (TREE_INT_CST_LOW (range))
                   > 10 * count)

Gcc wants 10% occupancy before it resorts to binary search.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]