From: Jørgen Kvalsvik Date: Mon, 3 Nov 2025 22:48:25 +0000 (+0100) Subject: gcc: -f*-coverage implies -ftest-coverage X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94fa0d52a233227f1f8da4c0b7ff4d079b9458e4;p=thirdparty%2Fgcc.git gcc: -f*-coverage implies -ftest-coverage The --coverage flag is a useful alias for -fprofile-arcs -ftest-coverage where the latter makes gcc output the .gcno file. While it makes sense to use -fprofile-arcs without a .gcno file (pgo, maybe more), it never really makes sense to request -fpath-coverage or -fcondition-coverage without also wanting the .gcno to interpret the results. gcc/ChangeLog: * common.opt: ftest-coverage enabled by fpath-coverage or fcondition-coverage gcc/testsuite/ChangeLog: * g++.dg/gcov/gcov-18.C: Remove --coverage. * g++.dg/gcov/gcov-22.C: Likewise. * gcc.misc-tests/gcov-19.c: Remove -ftest-coverage. * gcc.misc-tests/gcov-29.c: Likewise. --- diff --git a/gcc/common.opt b/gcc/common.opt index 4c73f51defa..88b79bbf8f5 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -3142,7 +3142,7 @@ Common Var(flag_syntax_only) Check for syntax errors, then stop. ftest-coverage -Common Var(flag_test_coverage) +Common Var(flag_test_coverage) EnabledBy(fpath-coverage || fcondition-coverage) Create data files needed by \"gcov\". fthread-jumps diff --git a/gcc/testsuite/g++.dg/gcov/gcov-18.C b/gcc/testsuite/g++.dg/gcov/gcov-18.C index 10578ec1865..945728a35e7 100644 --- a/gcc/testsuite/g++.dg/gcov/gcov-18.C +++ b/gcc/testsuite/g++.dg/gcov/gcov-18.C @@ -1,4 +1,4 @@ -/* { dg-options "--coverage -fcondition-coverage -std=c++11" } */ +/* { dg-options "-fcondition-coverage -std=c++11" } */ /* { dg-do run } */ /* { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } */ diff --git a/gcc/testsuite/g++.dg/gcov/gcov-22.C b/gcc/testsuite/g++.dg/gcov/gcov-22.C index 69e0728e3e4..892d59d8a71 100644 --- a/gcc/testsuite/g++.dg/gcov/gcov-22.C +++ b/gcc/testsuite/g++.dg/gcov/gcov-22.C @@ -1,4 +1,4 @@ -/* { dg-options "--coverage -fpath-coverage" } */ +/* { dg-options "-fpath-coverage" } */ /* { dg-do compile } */ #include diff --git a/gcc/testsuite/gcc.misc-tests/gcov-19.c b/gcc/testsuite/gcc.misc-tests/gcov-19.c index 17d6dde87c6..f555fede4fc 100644 --- a/gcc/testsuite/gcc.misc-tests/gcov-19.c +++ b/gcc/testsuite/gcc.misc-tests/gcov-19.c @@ -1,4 +1,4 @@ -/* { dg-options "-fcondition-coverage -ftest-coverage" } */ +/* { dg-options "-fcondition-coverage" } */ /* { dg-do run } */ /* Some side effect to stop branches from being pruned. */ diff --git a/gcc/testsuite/gcc.misc-tests/gcov-29.c b/gcc/testsuite/gcc.misc-tests/gcov-29.c index 5e3f0a914e5..ced21db8316 100644 --- a/gcc/testsuite/gcc.misc-tests/gcov-29.c +++ b/gcc/testsuite/gcc.misc-tests/gcov-29.c @@ -1,4 +1,4 @@ -/* { dg-options "--coverage -fpath-coverage" } */ +/* { dg-options "-fpath-coverage" } */ /* { dg-do run } */ void