[tree-ssa][mainline] Fix counting of line executions in gcov

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Wed Aug 27 21:25:00 GMT 2003


Hello,

>  >	* gcov.c (typedef struct arc_info): New field cs_count.
>  >	(accumulate_line_counts): Find cycles correctly.
> This is fine if you install a testcase with the patch.  It would seem
> to me the easiest way to get a testcase is to reformulate the original
> failing test's loop using gotos and use the result as your new testcase.

comitted together with the following testcase.

Zdenek

/* Test gcov block mode.  */

/* { dg-options "-fprofile-arcs -ftest-coverage" } */
/* { dg-do run { target native } } */

int main ()
{
  unsigned ix, jx = 0;
  
  ix = 10; goto test; loop: ; if (ix & 1) jx++; test: ; if (ix--) goto loop; /* count(11) */

  return jx != 5;
}

/* { dg-final { run-gcov { -a gcov-10b.c } } } */



More information about the Gcc-patches mailing list