Re: Ping [PATCH v4] Add condition coverage profiling

2023-06-29 Thread Jørgen Kvalsvik via Gcc-patches
On 23/06/2023 19:28, Jan Hubicka wrote: >>> >>> gcc/ChangeLog: >>> >>> * builtins.cc (expand_builtin_fork_or_exec): Check >>> profile_condition_flag. >>> * collect2.cc (main): Add -fno-profile-conditions to OBSTACK. >>> * common.opt: Add new options -fprofile-conditions and >>>

Ping [PATCH v4] Add condition coverage profiling

2023-06-23 Thread Jørgen Kvalsvik via Gcc-patches
On 13/06/2023 09:59, Jørgen Kvalsvik wrote: > This patch adds support in gcc+gcov for modified condition/decision > coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of > test/code coverage and it is particularly important in the avation and > automotive industries for safety-cri

[PATCH v4] Add condition coverage profiling

2023-06-12 Thread Jørgen Kvalsvik via Gcc-patches
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it is required for or reco

Ping^^ [PATCH v3] Add condition coverage profiling

2023-05-28 Thread Jørgen Kvalsvik via Gcc-patches
On 11/04/2023 15:23, Jørgen Kvalsvik wrote: > On 05/12/2022 10:40, Jørgen Kvalsvik wrote: >> This patch adds support in gcc+gcov for modified condition/decision >> coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of >> test/code coverage and it is particularly important in the a

Ping^ [PATCH v3] Add condition coverage profiling

2023-05-15 Thread Jørgen Kvalsvik via Gcc-patches
On 11/04/2023 15:23, Jørgen Kvalsvik wrote: > On 05/12/2022 10:40, Jørgen Kvalsvik wrote: >> This patch adds support in gcc+gcov for modified condition/decision >> coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of >> test/code coverage and it is particularly important in the a

Ping [PATCH v3] Add condition coverage profiling

2023-03-05 Thread Jørgen Kvalsvik via Gcc-patches
On 05/12/2022 10:40, Jørgen Kvalsvik wrote: > This patch adds support in gcc+gcov for modified condition/decision > coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of > test/code coverage and it is particularly important in the avation and > automotive industries for safety-cri

Ping [PATCH v3] Add condition coverage profiling

2022-12-19 Thread Jørgen Kvalsvik via Gcc-patches
On 05/12/2022 10:40, Jørgen Kvalsvik wrote: > This patch adds support in gcc+gcov for modified condition/decision > coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of > test/code coverage and it is particularly important in the avation and > automotive industries for safety-cri

[PATCH v3] Add condition coverage profiling

2022-12-04 Thread Jørgen Kvalsvik via Gcc-patches
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it is required for or reco

Re: [PATCH v2] Add condition coverage profiling

2022-12-01 Thread Jørgen Kvalsvik via Gcc-patches
On 02/12/2022 00:05, Martin Liška wrote: > On 11/11/22 06:21, Jørgen Kvalsvik wrote: >> From: Jørgen Kvalsvik >> >> This patch adds support in gcc+gcov for modified condition/decision >> coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of >> test/code coverage and it is particu

[PATCH v2] Add condition coverage profiling

2022-11-10 Thread Jørgen Kvalsvik via Gcc-patches
From: Jørgen Kvalsvik This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it

[Ping 2][PATCH] Add condition coverage profiling

2022-11-09 Thread Jørgen Kvalsvik via Gcc-patches
On 02/11/2022 07:16, Jørgen Kvalsvik wrote: > On 25/10/2022 08:33, Jørgen Kvalsvik wrote: >> On 12/10/2022 12:16, Jørgen Kvalsvik wrote: >>> This patch adds support in gcc+gcov for modified condition/decision >>> coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of >>> test/code

Ping [PATCH] Add condition coverage profiling

2022-11-01 Thread Jørgen Kvalsvik via Gcc-patches
On 25/10/2022 08:33, Jørgen Kvalsvik wrote: > On 12/10/2022 12:16, Jørgen Kvalsvik wrote: >> This patch adds support in gcc+gcov for modified condition/decision >> coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of >> test/code coverage and it is particularly important in the a

Ping [PATCH] Add condition coverage profiling

2022-10-24 Thread Jørgen Kvalsvik via Gcc-patches
On 12/10/2022 12:16, Jørgen Kvalsvik wrote: > This patch adds support in gcc+gcov for modified condition/decision > coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of > test/code coverage and it is particularly important in the avation and > automotive industries for safety-cri

Re: [PATCH] Add condition coverage profiling

2022-10-18 Thread Jørgen Kvalsvik via Gcc-patches
On 18/10/2022 02:17, Hans-Peter Nilsson wrote: > On Wed, 12 Oct 2022, Jørgen Kvalsvik via Gcc-patches wrote: >> This patch adds support in gcc+gcov for modified condition/decision >> coverage (MC/DC) with the -fprofile-conditions flag. > > I'd love improvements in thi

Re: [PATCH 1/2] gcov: test switch/break line counts

2022-10-14 Thread Jørgen Kvalsvik via Gcc-patches
On 13/10/2022 13:39, Richard Biener wrote: > On Tue, Oct 11, 2022 at 2:43 PM Jørgen Kvalsvik > wrote: >> >> The coverage support will under some conditions decide to split edges to >> accurately report coverage. By running the test suite with/without this >> edge splitting a small diff shows up, a

[PATCH] Add condition coverage profiling

2022-10-12 Thread Jørgen Kvalsvik via Gcc-patches
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it is required for or reco

Re: [PATCH 1/2] gcov: test switch/break line counts

2022-10-11 Thread Jørgen Kvalsvik via Gcc-patches
On 11/10/2022 15:55, Michael Matz wrote: > Hello, > > On Tue, 11 Oct 2022, Jørgen Kvalsvik via Gcc-patches wrote: > >> The coverage support will under some conditions decide to split edges to >> accurately report coverage. By running the test suite with/without this &

[PATCH 2/2] gcov: test line count for label in then/else block

2022-10-11 Thread Jørgen Kvalsvik via Gcc-patches
Add a test to catch regression in line counts for labels on top of then/else blocks. Only the 'goto ' should contribute to the line counter for the label, not the if. gcc/testsuite/ChangeLog: * gcc.misc-tests/gcov-4.c: --- gcc/testsuite/gcc.misc-tests/gcov-4.c | 26 ++

[PATCH 1/2] gcov: test switch/break line counts

2022-10-11 Thread Jørgen Kvalsvik via Gcc-patches
The coverage support will under some conditions decide to split edges to accurately report coverage. By running the test suite with/without this edge splitting a small diff shows up, addressed by this patch, which should catch future regressions. Removing the edge splitting: $ diff --git a/gc

Re: [PATCH 2/2] Split edge when edge locus and dest don't match

2022-10-11 Thread Jørgen Kvalsvik via Gcc-patches
wrote: >>>>> >>>>> On 10/5/22 14:04, Jørgen Kvalsvik via Gcc-patches wrote: >>>>>> Edges with locus are candidates for splitting so that the edge with >>>>>> locus is the only edge out of a basic block, except when the locuses >&

Re: [PATCH 2/2] Split edge when edge locus and dest don't match

2022-10-07 Thread Jørgen Kvalsvik via Gcc-patches
On 07/10/2022 08:53, Richard Biener wrote: > On Thu, Oct 6, 2022 at 4:28 PM Jørgen Kvalsvik > wrote: >> >> On 06/10/2022 10:12, Richard Biener wrote: >>> On Wed, Oct 5, 2022 at 2:49 PM Martin Liška wrote: >>>> >>>> On 10/5/22 14:04, Jørgen Kva

Re: [PATCH 2/2] Split edge when edge locus and dest don't match

2022-10-06 Thread Jørgen Kvalsvik via Gcc-patches
On 06/10/2022 10:12, Richard Biener wrote: > On Wed, Oct 5, 2022 at 2:49 PM Martin Liška wrote: >> >> On 10/5/22 14:04, Jørgen Kvalsvik via Gcc-patches wrote: >>> Edges with locus are candidates for splitting so that the edge with >>> locus is the only edge out

[PATCH 1/2] gcov: test switch/break line counts

2022-10-05 Thread Jørgen Kvalsvik via Gcc-patches
The coverage support will under some conditions decide to split edges to accurately report coverage. By running the test suite with/without this edge splitting a small diff shows up, addressed by this patch, which should catch future regressions. Removing the edge splitting: diff --git a/gcc/prof

[PATCH 2/2] Split edge when edge locus and dest don't match

2022-10-05 Thread Jørgen Kvalsvik via Gcc-patches
Edges with locus are candidates for splitting so that the edge with locus is the only edge out of a basic block, except when the locuses match. The test checks the last (non-debug) statement in a basic block, but this causes an unnecessary split when the edge locus go to a block which coincidentall

[PATCH 0/2] gcov: Split when edge locus differ from dest bb

2022-10-05 Thread Jørgen Kvalsvik via Gcc-patches
Original discussion: https://gcc.gnu.org/pipermail/gcc/2022-October/239544.html Some tiny test additions as well as more accurate check for when to split edges for coverage. This patch preserves the edge splitting heuristic except using a slightly more precise comparison, but makes a huge differen

Re: [PATCH] Add condition coverage profiling

2022-08-04 Thread Jørgen Kvalsvik via Gcc-patches
On 04/08/2022 09:43, Sebastian Huber wrote: > On 02/08/2022 09:58, Jørgen Kvalsvik wrote: >> Based on this established terminology I can think of a few good candidates: >> >> condition outcomes covered n/m >> outcomes covered n/m >> >> What do you think? > > Both are fine, but I would prefer "cond

Re: [PATCH] Add condition coverage profiling

2022-08-02 Thread Jørgen Kvalsvik via Gcc-patches
On 15/07/2022 15:47, Jørgen Kvalsvik wrote: > On 15/07/2022 15:31, Sebastian Huber wrote: >> On 15.07.22 13:47, Jørgen Kvalsvik via Gcc-patches wrote: >>> 2. New vocabulary for the output - decisions for, well, the decisions. It >>> also >>> w

Re: [PATCH] Add condition coverage profiling

2022-07-15 Thread Jørgen Kvalsvik via Gcc-patches
On 15/07/2022 15:31, Sebastian Huber wrote: > On 15.07.22 13:47, Jørgen Kvalsvik via Gcc-patches wrote: >> 2. New vocabulary for the output - decisions for, well, the decisions. It >> also >> writes at most one line per condition: >> >> decisions covered 1/

Re: [PATCH] Add condition coverage profiling

2022-07-15 Thread Jørgen Kvalsvik via Gcc-patches
On 15/07/2022 13:39, Jørgen Kvalsvik wrote: > This patch adds support in gcc+gcov for modified condition/decision > coverage (MC/DC) with the -fprofile-conditions flag. Hello, I have updated this patch based on the feedback from Sebastian and Martin. 1. The description of the masking_vector func

[PATCH] Add condition coverage profiling

2022-07-15 Thread Jørgen Kvalsvik via Gcc-patches
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it is required for or reco

Re: [PATCH] Add condition coverage profiling

2022-07-12 Thread Jørgen Kvalsvik via Gcc-patches
On 12/07/2022 16:05, Sebastian Huber wrote: > Hello Jørgen, > > thanks for the updated patch. I used it for a test suite run and the results > look quite good. > > Could you please add this hunk to your patch set: > > diff --git a/libgcc/libgcov-merge.c b/libgcc/libgcov-merge.c > index 89741f637

[PATCH] Add condition coverage profiling

2022-07-11 Thread Jørgen Kvalsvik via Gcc-patches
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage and it is particularly important in the avation and automotive industries for safety-critical applications. MC/DC it is required for or reco

Re: [PATCH] Add condition coverage profiling

2022-07-11 Thread Jørgen Kvalsvik via Gcc-patches
On 08/07/2022 15:45, Sebastian Huber wrote: > Hello Jørgen, > > some time passed. It would be nice if you could give a status update. I am > quite > interested in your work. > > Best regards, >     Sebastian > I'm sorry for the late updates. There have have been a lot of issues (with the patch

Re: [PATCH] Add condition coverage profiling

2022-04-22 Thread Jørgen Kvalsvik via Gcc-patches
On 22/04/2022 07:37, Sebastian Huber wrote: > > > On 17/04/2022 13:27, Jørgen Kvalsvik wrote: >>> In theory, would it be possible to print the state of the truth table with >>> the >>> information available in the gcda and gcno files? For example: >>> >>> Truth table for: a && (b || c)) && d >>>

Re: [PATCH] Add condition coverage profiling

2022-04-19 Thread Jørgen Kvalsvik via Gcc-patches
On 07/04/2022 14:04, Martin Liška wrote: > On 3/28/22 16:40, Jørgen Kvalsvik via Gcc-patches wrote: >> ... And with another tiny change that fixes Martin's while (1); case. > > Hello. > > Back to this ;) Thank you for the updated version of the patch. I have a >

Re: [PATCH] Add condition coverage profiling

2022-04-17 Thread Jørgen Kvalsvik via Gcc-patches
On 06/04/2022 09:35, Sebastian Huber wrote: > Ok, for the default output this is good. The output can be explained in the > documentation. I will try to help here. Splendid, thanks! I would be perfectly happy with better and/or more intuitive messages too, but I figured it shouldn't delay the rest

[PATCH] Add condition coverage profiling

2022-04-08 Thread Jørgen Kvalsvik via Gcc-patches
On 08/04/2022 09:28, Jørgen Kvalsvik wrote: > On 07/04/2022 18:53, Sebastian Huber wrote: >> Hello Jørgen, >> >> there could be an issue with conditions in for loops: >> >>     3:  189:  for (int a = 0; a <= 1; ++a) { >> branch  0 taken 2 >> branch  1 taken 1 (fallthrough) >> conditions covered

[PATCH] Add condition coverage profiling

2022-04-08 Thread Jørgen Kvalsvik via Gcc-patches
On 07/04/2022 18:53, Sebastian Huber wrote: > Hello Jørgen, > > there could be an issue with conditions in for loops: > >     3:  189:  for (int a = 0; a <= 1; ++a) { > branch  0 taken 2 > branch  1 taken 1 (fallthrough) > conditions covered 0/2 > condition  0 not covered (true) > condition 

[PATCH] Add condition coverage profiling

2022-04-05 Thread Jørgen Kvalsvik via Gcc-patches
f L_gcov_merge_topn >  void __gcov_merge_topn (gcov_type *counters  __attribute__ ((unused)), >     unsigned n_counters __attribute__ ((unused))) {} > > It seems that support for the new GCOV_TAG_CONDS is missing in gcov-tool and > gcov-dump, see "tag_table"

[PATCH] Add condition coverage profiling

2022-03-25 Thread Jørgen Kvalsvik via Gcc-patches
e, but I think the overall approach is easy to grasp when supported by a lot of example graphs and stepping. I will try to type up a bunch with the paper and publish, but for now all I have is the code (which I hope for the most part is easy to follow). I'll update this with style updates and a

[PATCH] Add condition coverage profiling

2022-03-21 Thread Jørgen Kvalsvik via Gcc-patches
This patch adds support in gcc+gcov for modified condition/decision coverage (MC/DC) with the -fprofile-conditions flag. MC/DC is a type of test/code coverage, and it is particularly important in the avation and automotive industries for safety-critical applications. In particular, it is required o