<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - alpha.deadcode.UnreachableCode is confused by caller"
   href="https://bugs.llvm.org/show_bug.cgi?id=37659">37659</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>alpha.deadcode.UnreachableCode is confused by caller
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>abramo.bagnara@bugseng.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If the function where the dead code is placed is called the checker does not
report anything.

Here below we can see that the dead code is reported for function e (not
called), but not reported for identical function f (called by g).

$ cat p.c
int e() {
  if (1) {
    return 1;
  }
  return 2;
}

int f() {
  if (1) {
    return 3;
  }
  return 4;
}

void g() {
  f();
}


$ clang-7 -cc1 -analyze -analyzer-checker=alpha.deadcode.UnreachableCode p.c
p.c:5:10: warning: This statement is never executed
  return 2;
         ^
1 warning generated.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>