On 3/13/26 11:07, Jakub Jelinek wrote:
On Fri, Mar 13, 2026 at 10:54:33AM +0100, Jørgen Kvalsvik wrote:
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gcov/pr124462.C
@@ -0,0 +1,29 @@
+/* PR ipa/124462 */
+/* { dg-options "-O -fcondition-coverage -fdump-tree-gimple-all" }  */

Without the -fdump-tree-gimple-all part in there.

--- a/gcc/tree-profile.cc
+++ b/gcc/tree-profile.cc
@@ -542,6 +542,8 @@ masking_vectors (conds_ctx& ctx, array_slice<basic_block> 
blocks,
        for (edge e : b->preds)
          if (!(e->flags & EDGE_COMPLEX))
            ctx.edges.quick_push (contract_edge_up (e));
+       if (ctx.edges.length () < 2)
+         continue;
        ctx.edges.sort (topological_src_cmp, &ctx.top_index);
for (size_t i0 = 0, i1 = 1; i1 != ctx.edges.length (); ++i0, ++i1)

Otherwise LGTM.

Thanks, I'll push it.


Note, big parts of tree-profile.cc now use some weird formatting, not GCC
style, indentation by 4 columns instead of 2, { on the same column as line
above it instead of 2 columns to the right, etc.  I think it would be nice
to get that incrementally fixed.

Yeah, since writing the MC/DC support it I've changed my setup to properly apply the GNU style, but I haven't wanted to make too much noise with patches for it. I can change the style incrementally whenever I pass over this, or maybe even a single pass that fixes all of it.

Thanks,
Jørgen


     for (basic_block b : blocks)
     {
         if (!bitmap_bit_p (core, b->index))
             continue;
should have been
   for (basic_block b : blocks)
     {
       if (!bitmap_bit_p (core, b->index))
        continue;
or
     const_basic_block l = *(const basic_block*) lhs;
should have been
   const_basic_block l = *(const basic_block *) lhs;
etc.
See https://gcc.gnu.org/contribute.html#standards

        Jakub


Reply via email to