<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/69973>69973</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            SimpleSValBuilder.cpp:770: void assertEqualBitWidths ... Assertion `RhsBitwidth == LhsBitwidth && "RhsLoc and LhsLoc bitwidth must be same!"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
            vabridgers
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          vabridgers
      </td>
    </tr>
</table>

<pre>
    The analyzer crashes when analyzing the following test case using address types of different sizes. 

clang -cc1 -analyze -triple amdgcn-unknown-unknown  -analyze -analyzer-checker=core ./test.c

```c
__attribute__((address_space(3))) void *b();
__attribute__((address_space(3))) int *c();
typedef struct {
 __attribute__((address_space(3))) int *e;
} f;
void g() {
 __attribute__((address_space(3))) void *h = b();
 __attribute__((address_space(3))) int *i = c();
 __attribute__((address_space(3))) f *j = i;
  j->e == h;
}
```

$ clang -cc1 -analyze -triple amdgcn-unknown-unknown -analyze -analyzer-checker=core   ./test.c

clang: <root>/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:770: void assertEqualBitWidths(clang::ento::ProgramStateRef, clang::ento::Loc, clang::ento::Loc): Assertion `RhsBitwidth == LhsBitwidth && "RhsLoc and LhsLoc bitwidth must be same!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: clang -cc1 -analyze -triple amdgcn-unknown-unknown -analyze -analyzer-checker=core ./test.c
1.      <eof> parser at end of file
2.      While analyzing stack:
        #0 Calling g
3. ./test.c:11:3: Error evaluating statement
4.      ./test.c:11:3: Error evaluating statement
 #0 0x0000000001e600a8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (<root>/bin/clang-18+0x1e600a8)
 #1 0x0000000001e5d7dc SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f66833e0630 __restore_rt sigaction.c:0:0
 #3 0x00007f6681ef4387 raise (/lib64/libc.so.6+0x36387)
 #4 0x00007f6681ef5a78 abort (/lib64/libc.so.6+0x37a78)
 #5 0x00007f6681eed1a6 __assert_fail_base (/lib64/libc.so.6+0x2f1a6)
 #6 0x00007f6681eed252 (/lib64/libc.so.6+0x2f252)
 #7 0x00000000042c7bfb (anonymous namespace)::SimpleSValBuilder::evalBinOpLL(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::BinaryOperatorKind, clang::ento::Loc, clang::ento::Loc, clang::QualType) SimpleSValBuilder.cpp:0:0
 #8 0x00000000042d6337 clang::ento::SValBuilder::evalBinOp(llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>, clang::BinaryOperatorKind, clang::ento::SVal, clang::ento::SVal, clang::QualType) (<root>/bin/clang-18+0x42d6337)
 #9 0x00000000042225ee clang::ento::ExprEngine::VisitBinaryOperator(clang::BinaryOperator const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (<root>/bin/clang-18+0x42225ee)
#10 0x000000000420edf1 clang::ento::ExprEngine::Visit(clang::Stmt const*, clang::ento::ExplodedNode*, clang::ento::ExplodedNodeSet&) (<root>/bin/clang-18+0x420edf1)
#11 0x000000000420f695 clang::ento::ExprEngine::ProcessStmt(clang::Stmt const*, clang::ento::ExplodedNode*) (<root>/bin/clang-18+0x420f695)
#12 0x000000000421766a clang::ento::ExprEngine::processCFGElement(clang::CFGElement, clang::ento::ExplodedNode*, unsigned int, clang::ento::NodeBuilderContext*) (<root>/bin/clang-18+0x421766a)
#13 0x00000000041cc2fb clang::ento::CoreEngine::HandlePostStmt(clang::CFGBlock const*, unsigned int, clang::ento::ExplodedNode*) (<root>/bin/clang-18+0x41cc2fb)
#14 0x00000000041cc73b clang::ento::CoreEngine::dispatchWorkItem(clang::ento::ExplodedNode*, clang::ProgramPoint, clang::ento::WorkListUnit const&) (<root>/bin/clang-18+0x41cc73b)
#15 0x00000000041cc87a clang::ento::CoreEngine::ExecuteWorkList(clang::LocationContext const*, unsigned int, llvm::IntrusiveRefCntPtr<clang::ento::ProgramState const>) (<root>/bin/clang-18+0x41cc87a)
#16 0x0000000003c0f163 (anonymous namespace)::AnalysisConsumer::HandleCode(clang::Decl*, unsigned int, clang::ento::ExprEngine::InliningModes, llvm::DenseSet<clang::Decl const*, llvm::DenseMapInfo<clang::Decl const*, void>>*) AnalysisConsumer.cpp:0:0
#17 0x0000000003c35d72 (anonymous namespace)::AnalysisConsumer::HandleDeclsCallGraph(unsigned int) AnalysisConsumer.cpp:0:0
#18 0x0000000003c373e5 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit(clang::ASTContext&) AnalysisConsumer.cpp:0:0
#19 0x00000000043372f9 clang::ParseAST(clang::Sema&, bool, bool) (<root>/bin/clang-18+0x43372f9)
#20 0x000000000291e3e9 clang::FrontendAction::Execute() (<root>/bin/clang-18+0x291e3e9)
#21 0x000000000289f3ce clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (<root>/bin/clang-18+0x289f3ce)
#22 0x00000000029fd4ae clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (<root>/bin/clang-18+0x29fd4ae)
#23 0x0000000000b1d736 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (<root>/bin/clang-18+0xb1d736)
#24 0x0000000000b1525a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#25 0x0000000000b19d4a clang_main(int, char**, llvm::ToolContext const&) (<root>/bin/clang-18+0xb19d4a)
#26 0x0000000000a69f01 main (<root>/bin/clang-18+0xa69f01)
#27 0x00007f6681ee0555 __libc_start_main (/lib64/libc.so.6+0x22555)
#28 0x0000000000b14d4d _start (<root>/bin/clang-18+0xb14d4d)


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWV9z4yj2_TTkhYpLAkuyHvzgOPb8Ur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