diff --git a/gcc.spec b/gcc.spec index a3de399..e05a5f5 100644 --- a/gcc.spec +++ b/gcc.spec @@ -5,7 +5,7 @@ %global gcc_major 11 # Note, gcc_release must be integer, if you want to add suffixes to # %%{release}, append them after %%{gcc_release} on Release: line. -%global gcc_release 13 +%global gcc_release 14 %global nvptx_tools_gitrev 5f6f343a302d620b0868edab376c00b15741e39e %global newlib_cygwin_gitrev 50e2a63b04bdd018484605fbb954fd1bd5147fa0 %global _unpackaged_files_terminate_build 0 @@ -351,6 +351,7 @@ Patch1002: gcc11-libstdc++-prettyprinter-update-15-tests-48362.patch # Backports Patch2000: gcc11-fix-failures-with-default-SSP.patch Patch2001: gcc11-disable-stack-protector-for-tests-relying-on-stack-offset.patch +Patch2002: gcc11-gcov-show-branches-and-calls.patch # On ARM EABI systems, we do want -gnueabi to be part of the # target triple. @@ -1073,6 +1074,7 @@ mark them as cross compiled. %patch2000 -p1 -b .fix-failures-with-default-SSP %patch2001 -p1 -b .disable-stack-protector-for-tests-relying-on-stack-offset +%patch2002 -p1 -b .gcov-show-branches-and-calls %ifarch %{arm} rm -f gcc/testsuite/go.test/test/fixedbugs/issue19182.go @@ -3869,6 +3871,10 @@ end %endif %changelog +* Thu Oct 30 2025 David Malcolm - 11.5.0-14 +- Add backport of upstream r15-8946-g580664d1b66a5d to gcc 11, adding + branches and calls to gcov output, but not conditions (RHEL-105416). + * Tue Oct 14 2025 David Malcolm - 11.5.0-13 - Fix testsuite failures when run with -fstack-protector* (PR testsuite/70230, RHEL-116477) diff --git a/gcc11-gcov-show-branches-and-calls.patch b/gcc11-gcov-show-branches-and-calls.patch new file mode 100644 index 0000000..d2fe4d4 --- /dev/null +++ b/gcc11-gcov-show-branches-and-calls.patch @@ -0,0 +1,52 @@ +diff --git a/gcc/gcov.c b/gcc/gcov.c +index cf0a49d8c30..e9cd2f5505d 100644 +--- a/gcc/gcov.c ++++ b/gcc/gcov.c +@@ -1497,11 +1497,16 @@ generate_results (const char *file_name) + memset (&coverage, 0, sizeof (coverage)); + coverage.name = fn->get_name (); + add_line_counts (flag_function_summary ? &coverage : NULL, fn); +- if (flag_function_summary) +- { +- function_summary (&coverage); +- fnotice (stdout, "\n"); +- } ++ ++ if (!flag_function_summary) ++ continue; ++ ++ for (const block_info& block : fn->blocks) ++ for (arc_info *arc = block.succ; arc; arc = arc->succ_next) ++ add_branch_counts (&coverage, arc); ++ ++ function_summary (&coverage); ++ fnotice (stdout, "\n"); + } + + name_map needle; +@@ -2480,6 +2485,25 @@ function_summary (const coverage_info *coverage) + { + fnotice (stdout, "%s '%s'\n", "Function", coverage->name); + executed_summary (coverage->lines, coverage->lines_executed); ++ ++ if (coverage->branches) ++ { ++ fnotice (stdout, "Branches executed:%s of %d\n", ++ format_gcov (coverage->branches_executed, coverage->branches, 2), ++ coverage->branches); ++ fnotice (stdout, "Taken at least once:%s of %d\n", ++ format_gcov (coverage->branches_taken, coverage->branches, 2), ++ coverage->branches); ++ } ++ else ++ fnotice (stdout, "No branches\n"); ++ ++ if (coverage->calls) ++ fnotice (stdout, "Calls executed:%s of %d\n", ++ format_gcov (coverage->calls_executed, coverage->calls, 2), ++ coverage->calls); ++ else ++ fnotice (stdout, "No calls\n"); + } + + /* Output summary info for a file. */