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

    <tr>
        <th>Summary</th>
        <td>
            LLVM 11 regression: assertion "conflicting locations for variable"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            regression
      </td>
    </tr>

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

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

<pre>
    reproduces with assert builds of:
 * LLVM 14.0.6
 * LLVM 13.0.1
 * LLVM 12.0.0-rc4
 * LLVM 11.0.1

does NOT reproduce with assert builds of:

 * LLVM 10.0.1

Reduction: 66KB .ll file here: https://github.com/ziglang/zig/issues/8442#issuecomment-1177111026

Repro:

```
$ ~/local/llvm13-debug/bin/clang -c reduced.ll -O2
clang: /home/andy/Downloads/llvm-project-13/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp:319: void llvm::DbgVariable::addMMIEntry(const llvm::DbgVariable&): Assertion `(FrameIndexExprs.size() == 1 || llvm::all_of(FrameIndexExprs, [](FrameIndexExpr &FIE) { return FIE.Expr && FIE.Expr->isFragment(); })) && "conflicting locations for variable"' failed.
```

Downstream issue: #8442
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVNty2yAQ_Rr0wlgjgSzLD3qwI6eTadJ0Op28dpBYybRIeADl9vVdJCdx497GDIjd5XB29-DayKfSwsEaOTbg6IPyeyqcA-tpPSotHTUt4RuSVCTZUMI29Pr67oamWZzE-ZmVozU9szK0JgvbZGee9C1-nqVBEp9uv9JXTv-gdAaZvIf8AgjjlRnwDM3zj1saa01bpYHuwUKw7r0_uADJLnF0eOFYx43pcfOsOi2Gbv7CWTk3gsOPIssYYXzaY2gPg1-k6WqVpmnC8l8JYCrvCJM8OY55yzJKVjuE1aYROqz6vk_5QkI9hmtrNeDcBCp00WB1QmlkSGRxy2aMyRmywcC96QEXMcgnXCrzMGgjpDviLpDPd2iQLz9awqJqnC-MhA8Q7tq4_rNVgwcbEB6EbavAJW4OB7yEp-tw1b1Rkk4AmB7fVHV3J6wStYbZIKS8ubnaDd4ij6Ixg_N_CMeSsQlyM3Ua20VDdVhxaUUPV4OEx93jwbrYqWeMLjCaEl7hoCmW7gLHCbLQ-huK5Ow0YReULLdkWZ35sGz55dVuwl1tscJ-tANFS_zixfG6XxC-Uw4RutD4mQ_hWzxaha8AMh8gjGHarVYoQexdaG9IztHWWHr_mj1KaUVbgaKU8e8VMs2hk85bED2dhDe3mwctRrLkcs3XIvLKayiPDwwT6Sw4d9S_eKvufxKLRqvLvzyQF_mc6Or0mSzzLC2ifZlla54sGYimyfCRrAte8CbPZF6LmhcYokUN2pWhO4xNomdTtxg7yQBtyypSJUsYS1b4Wy5z_HvJcmiTOl_njLVpwhuSJdBjMePAKja2i2w5EURch06tnHdvTiyK6gaAcpZGJEa_N7bE12Phwf6IpmTKKZOfI_SMyQ">