[LLVMbugs] [Bug 18490] New: Detect dead code in a loop

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 15 10:12:13 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18490

            Bug ID: 18490
           Summary: Detect  dead code in a loop
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: daniel at zuster.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Clang should detect and warn about the dead code in the following loop, either
from regular flow analysis warnings (if we can do it cheap enough), but if not
that then from the static analyzer:
--
$ cat t.c
void f0(int);
void f1() {
  int first = 1;
  for (int i = 0; i < 5; ++i) {
    if (first) continue;
    f0(i);
    first = 0;
  }
}
$ clang -c -Weverything --analyze t.c
$ 
--

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140115/966cebc2/attachment.html>


More information about the llvm-bugs mailing list