Hi Martin, > On 05/16/2018 03:39 PM, Alexander Monakov wrote: >> On Wed, 16 May 2018, Martin Liška wrote: >>>> Hm, is the off-by-one in the new explanatory text really intended? I think >>>> the previous text was accurate, and the new text should say "9th and 10th" >>>> and then "first 10 invocations", unless I'm missing something? >>> >>> I've reconsidered that once more time and having zero-based values: >>> * -fdbg-cnt=event:N - trigger event N-times >>> * -fdbg-cnt=event:N:(N+M) - skip even N-times and then enable it M-1 times >>> >>> Does that make sense? >> >> Yes, I like this, but I think the implementation does not match. New docs >> say: >> >>> -For example, with @option{-fdbg-cnt=dce:10,tail_call:0}, >>> -@code{dbg_cnt(dce)} returns true only for first 10 invocations. >>> +For example, with @option{-fdbg-cnt=dce:2:4,tail_call:10}, >>> +@code{dbg_cnt(dce)} returns true only for third and fourth invocation. >>> +For @code{dbg_cnt(tail_call)} true is returned for first 10 invocations. >> >> which is good, but the implementation reads: >> >>> bool >>> dbg_cnt_is_enabled (enum debug_counter index) >>> { >>> - return count[index] <= limit[index]; >>> + unsigned v = count[index]; >>> + return v >= limit_low[index] && v < limit_high[index]; >>> } >> >> which I believe is misaligned with the docs' intention. It should be the >> other way around: >> >> return v > limit_low[index] && v <= limit_high[index]; > > Note that I changed count[index]++ to happen after dbg_cnt_is_enabled. I'm > reverting that > and now it works fine with your condition.
I'm seeing a testsuite regression for +FAIL: gcc.dg/pr68766.c (test for excess errors) on 32 and 64-bit Solaris/x86, Linux/x86_64, also seen on i686-pc-linux-gnu, powerpc64le-unknown-linux-gnu. Excess errors: dbg_cnt 'vect_loop' set to 0-1 Either the adjustment to gcc.dg/pr68766.c is wrong or not generic. Please fix. Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University