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

    <tr>
        <th>Summary</th>
        <td>
            Undefined behavior sanitizer missed case with uninitialized arrays 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            enhancement,
            compiler-rt:ubsan
      </td>
    </tr>

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

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

<pre>
    I found this based on reading https://discourse.llvm.org/t/clang-assigning-an-uninitialized-array-to-another-array-produces-undefined-behavior-with-optimization-o1/72763 

the following code which I believe is undefined behavior based on 
`the value of an object with automatic storage duration is used while it is indeterminateā€ (C99 draft).`

is not detected by `-fsanitize=undefined,address`

```
#include <stdio.h>

#define N 4
int ia[N];
int main (void) { 
    int i, ib[N];
  
    for (i = 0; i < N; i++)
        ia[i] = ib[i];

    /* check results: */  
    for (i = 0; i < N; i++)
       printf("%d : %d\n",ia[i], ib[i]);

    return 0;
}

```
The output does change based on optimization levels which indicates to me that this is undefined behavior 

https://godbolt.org/z/s9T6TdEbd
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVMFu67gO_RpmQziw5TiJF140SQPcTVd9HyBbdMw3shRIdIr26weyc5u2czGbAYxEks1zDiny6Bj54ogaqA5QnVZ6ksGH5m0gLaN2q9ab9-YX9n5yBmXgiK2OZNA7DKQNuwsOItcI5ROoM6iz4dj5KURaW3sb1z5cQJ0F1Lmz2l2yhY_TymWTY8fC2vIHmUyHoN8z8Zl2XgYK94Nr8GbqKGaTM9SzI5O1NOgb-5C9sQyZvwqP_KGFvct8Aeq8U7ttiZCfIH9afmUg7L21_i0p7rwhfBu4G_AXtmSZboQc8ZMBfzM8sr2jbfMEddN2IvQ9aoe-_T91gkkK6kn8qIU7jOKDvhCaKczCZvgE9TawJWRJB-wMCYWRnRaCZwX7HOoTgtof6xpN0L2Aqtewzb_mwhGdF0yhnSSt7wjbPOujTsX8IChPn4mAOmpjAsX4AyRtl2fZqpJdZydDCOUximG_HqB8_haiygUVX3Bzl-IEWUN1eIHqBOXhcTpqdimRm2cDqkbYHe4lRESc40Adkdufwfjls96HhMEI5QlzKA-Ylkd8mZegDvNTPwJm7KSHoTrNUTMBfyV4fD037BN2A3V_YaA4WUl9jKBSL_9XIdfATnpQe1AKVGVwga4MVEc3nx0_pX6WYtnUfxAbSKbgZvL7q93pXy70dSD0k1wnQeMpYjdod6FHO38dGrR0IxvvE8HOcKeFIorHkVAGLcvk_3lCvor4bgUXb1pv5e4BH6DOsX7dvprn1qxMU5q6rPWKmmJbq1xtVVWthiZXxb5WVZHvdb8p-irXRbdr892m1JtCVd2KG5WrMt8Xm6IqdmW11nqv-rKuq22fq7qoYZPTqNl--s-KY5yo2W62-83K6pZsnN1OKXKDdh2N5GS5EFCq8-OVLYUsCJRPUxv1fFnVaRWahJi10yXCJrccJT44hMVS879_luf3VAYcOabidzrS4hbf7A9nt4u4moJtftSRZZjadedHUOfEeP9L1pi8B9R5TjGCOs9Z_h0AAP__Vm7EFw">