title: How many branches are in a (a && b) statement? According to gcov: 4
body: <p>I compiled the following program with "gcc -fprofile-arcs -ftest-coverage test.c":</p>
  
  <pre><code>int main() {
    int a = 1;
    int b = 1;
    a &amp;&amp; b;
  }
  </code></pre>
  
  <p>After running the program, an invocation of "gcov -bc test.c" reports that 50% of 4 branches were taken at least once. Why does gcov say the program has four branches, instead of two? After running the following program, gcov correctly reports that 50% of 2 branches were taken at least once:</p>
  
  <pre><code>int main() {
    int a = 1;
    if (a)
      a = 0;
    else
      a = 1;
  }
  </code></pre>