Open llvmbot opened 16 years ago
Devin, is this still relevant?
It looks like this problem was addressed sometime in the past year -- I no longer get the assertion failure w/ r81189 on Linux/x86_64.
Should this bug be closed?
The crash no longer occurs, but the analyzer still isn't doing the right thing w.r.t. to handling the byte load from a larger integer/object.
It looks like this problem was addressed sometime in the past year -- I no longer get the assertion failure w/ r81189 on Linux/x86_64.
Should this bug be closed?
This is the same bug as:
rdar://problem/6151550 support addressing into a specific byte of a larger object
The problem is that we don't correctly handle the EvalLoad into a specific byte of a larger integer. EvalLoad should not assume that we're loading the entire specified object.
This bug will get fixed once more of the support for abstract "regions" is in place and we can handle offsets into regions. We will then have to reason about the endianness of the system to support the correct byte loads from a larger integer value.
Is this a bug in the checker or in clang?
assigned to @devincoughlin
Extended Description
[s002:165] [rwg@mini /tmp]% uname -a; svn info ~/llvm/llvm ~/llvm/llvm/tools/clang | grep Revision: Darwin mini.local 9.5.0 Darwin Kernel Version 9.5.0: Wed Sep 3 11:31:44 PDT 2008; root:xnu-1228.7.58~1/RELEASE_PPC Power Macintosh Revision: 56425 Revision: 56427 [s002:166] [rwg@mini /tmp]% cat t3.c int f() { short a = 1; return !(((char *)&a)[0]); }
[s002:167] [rwg@mini /tmp]% clang -x c t3.c
[s002:168] [rwg@mini /tmp]% clang -x c t3.c -checker-cfref ANALYZE: t3.c f Assertion failed: (BitWidth == RHS.BitWidth && "Comparison requires equal bit widths"), function operator==, file /Users/rwg/llvm/llvm/include/llvm/ADT/APInt.h, line 792. 0 clang 0x00492a7c _ZN4llvm3sys7Program17FindProgramByNameERKSs + 796 1 clang 0x00492e34 _ZN4llvm3sys28PrintStackTraceOnErrorSignalEv + 760 2 libSystem.B.dylib 0x96a836a4 _sigtramp + 68 3 clang 0x0047845c _ZN4llvm16FoldingSetNodeID10AddPointerEPKv + 64 zsh: abort clang -x c t3.c -checker-cfref
If you remove the "!" in the return statement, it doesn't throw the assertion failure.
The same assertion failure is seen on Debian 4.0/i386 with llvm r56423 / clang r56415.