<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - More complex analysis for -Wuninitialized"
   href="https://llvm.org/bugs/show_bug.cgi?id=29077">29077</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>More complex analysis for -Wuninitialized
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>lebedev.ri@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17019" name="attach_17019" title="Reduced testcase">attachment 17019</a> <a href="attachment.cgi?id=17019&action=edit" title="Reduced testcase">[details]</a></span>
Reduced testcase

Manually reduced from babl conv_y8_yF() function:


#include <stdint.h>
#include <smmintrin.h>

void x1()
{
  __m128i x2;
  x2 = _mm_insert_epi32 (x2, 0, 0);
  x2 = _mm_cvtepu8_epi32 (x2);
}


It stores some integer in first element of a 4-component vector, and
then _mm_cvtepu8_epi32() "Zero extends packed unsigned 8-bit integers in a to
packed 32-bit integers, and store the results in x2."

So it is pretty clear that there is no actual read/use of uninitialized values.
It would be awesome if clang would be so smart not to warn here.


Currently it fails with:

complex-uninitialized.c:7:26: warning: variable 'x2' is uninitialized when used
here [-Wuninitialized]
  x2 = _mm_insert_epi32 (x2, (uint32_t) 0, 0);
                         ^~
/usr/lib/llvm-4.0/bin/../lib/clang/4.0.0/include/smmintrin.h:225:70: note:
expanded from macro '_mm_insert_epi32'
                                   ({ __v4si __a = (__v4si)(__m128i)(X); \
                                                                     ^
complex-uninitialized.c:6:3: note: variable 'x2' is declared here
  __m128i x2;
  ^</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>