Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

alpha.deadcode.UnreachableCode false positive #30619

Open Quuxplusone opened 7 years ago

Quuxplusone commented 7 years ago
Bugzilla Link PR31646
Status NEW
Importance P normal
Reported by Roberto Bagnara (bagnara@cs.unipr.it)
Reported on 2017-01-15 06:42:13 -0800
Last modified on 2020-04-17 15:10:51 -0700
Version 4.0
Hardware PC Linux
CC dpetrov@accesssoftek.com, llvm-bugs@lists.llvm.org
Fixed by commit(s)
Attachments z.c (69 bytes, text/x-csrc)
Blocks
Blocked by
See also
Created attachment 17842
Testcase allowing reproduction of the problem.

$ cat z.c
union U {
  int a;
};

int foo(union U u) {
  return u.a ? 1 : 0;
}

$ clang-4.0 -cc1 -analyze -analyzer-checker=alpha.deadcode.UnreachableCode z.c
z.c:6:20: warning: This statement is never executed
  return u.a ? 1 : 0;
                   ^
1 warning generated.
$ clang-4.0 --version
clang version 4.0.0-svn291446-1~exp1 (trunk)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$
Quuxplusone commented 7 years ago

Attached z.c (69 bytes, text/x-csrc): Testcase allowing reproduction of the problem.

Quuxplusone commented 4 years ago
I could not reproduce the issue on the given code snippet. clang 10.x
Can it be considered as resolved one?