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

    <tr>
        <th>Summary</th>
        <td>
            On x86-64 trunk, `-Wconditional-uninitialized` false positive in a "simple" case
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            false-positive
      </td>
    </tr>

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

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

<pre>
    `-Wconditional-uninitialized` claims `c` may be uninitialized when used in `if (c)`, but if it's used `b` must be true, meaning `b` must not be false, meaning `c` must have been assigned `false`.

https://godbolt.org/z/PzdeMq84M

```
void test(bool a) 
{
    bool b = true;
    bool c;

    if (a)
    {
        c = false;
    }
    else
    {
        b = false;
    }

    if (b)
 {
        if (c)
        {

        }  
    }
}
```

I see as of 2018, "-Wconditional-uninitialized is expected to have false positives: it warns in cases where a simple control flow analysis cannot prove that a variable was written to prior to each use." but I'm not sure what qualifies as "simple". https://bugs.llvm.org/show_bug.cgi?id=38856
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEVE2P2zYQ_TWjy8AGNZJl-aCD04WBHIL21mNBUmNrWpp0RMrO7q8vKLm7UdA2hmFLozcfb94TdYxy8cwd7D7B7qXQUxrC2BmnPZ_HVy5M6F87aNTmdxt8L0mC124zefGSRDt54x4ahdZpuUaERtl8e9WvaBhXMHwM7HGK3KP4jJQzArUW6ACNAvoFzZRQzigJaB8XJDTKzAWnmHLFNE6coVfWXvxl_dyHGXPWLv4Isu-gQd8ZDbPHJ_e5yZLTqC2oI6jjkNItQnUEOgGdLqE3waVtGC9Apzeg029vPX_52tZfFnief_mq4z1Ij4ljAmpNCA410AEzaP8J1BERcQ4bhOpl4VOtHtjl_hlalpRrPAMfZfLHzlWW6d_LwP7lecU5_m955r_zVo3Ns_E6-zvlPoILZBV4QVyXXn6_2xao42eMzKgjhjOSKtusHBD9j-FQIvK3G9vEPaawSDpzwVuIkuTOWTyUhA89-pj9ZnXkmC04MmqMcr05Rht8GoPDswsP1F671ygRrfbZSbcx3BnToBNqvOtRtHGMDx3xMUpK7HPr2yhhzBes7ZAtuwWi2cifgfbX2ZJxGhkfuc7XSTs5C8dMF4iWMYBoi2vHmekSt87dr0_PxSE8_jDTZWsvAtVJeqheqrbdNUXfVf2hOuiCu3Jf11S2qqyKodtbKtVuZ8tamZaM4l4b4r7q2aiqPreFdKRop2p1KPdKlbTVZVlV-tDsy0Ov60MFteKrFvc-RyExTtyV1U7tVOG0YRfnc4NoXv7mn-UDUT5Lxi5nbjIXqJWTmD44FUmS4-5Xj9_aZtPU-UXwf83S__SsWSudxdWrZc5aF9Pouh9eY0nDZLY2XIFOeZDn3-Y2hj_ZJqDTzDACnZ4k7x39HQAA__9jfIu1">