https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92283

--- Comment #14 from Martin Liška <marxin at gcc dot gnu.org> ---
> 
> more complex "ranges" for debug counters appreciated,

+1

> -fdbg-cnt=foo:{5-6,9,1-10} or some sorts of that (lists of ranges / values).
> I'm definitely missing a all-but-N as well. ~6 and ~6-9 maybe.  Guess
> {} don't work very well due to shell limitations so maybe
> simply foo:5-6:9:1-10,bar:... with changing semantics of previous handling.

Note that the debug counter is mainly for us as developers, so I would not
care much about backward compatibility.

> Implementation-wise we'd have instead of high/low arrays
> an array of pair<counter, vec<pair<high, low> > which we only look at
> the last element of the vec (sort it backwards), popping it whenever
> we reach it's max and checking against the current min.  or some
> other data structure mimicing this, that is, dbg_cnt () is still O(1)
> just parsing the option might involve sorting.

Yes, one simple improvement can be:
foo:5-6:9:10-100:1000 where we can enforce that ranges are in increasing
order and not overlapping. Or we can sort the ranges and then dbg_cnt will
be O(1) with the popping technique.

I can work on that after we discuss the extended format.

Reply via email to