<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 --- - Bogus .loc directive with -mavx"
   href="https://llvm.org/bugs/show_bug.cgi?id=30682">30682</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bogus .loc directive with -mavx
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </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>Backend: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>paul_robinson@playstation.sony.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=17431" name="attach_17431" title="test case">attachment 17431</a> <a href="attachment.cgi?id=17431&action=edit" title="test case">[details]</a></span>
test case

Compiling the attached test case for X64 Linux as
   clang -c -g -S bz159663-min.cpp -mno-avx -o okay.s
and
   clang -c -g -S bz159663-min.cpp -mavx -o bad.s
and diffing the results, we see the obvious instruction differences
but also 'bad.s' has some weird stuff going on with the .loc directives.
Here's an extract from a diff, showing the assembler text generated
for source line 11 (the call to method setY):

***************
      .loc    1 11 33 is_stmt 1       # bz159663-min.cpp:11:33
      movl    -12(%rbp), %ecx
      .loc    1 11 45 is_stmt 0       # bz159663-min.cpp:11:45
      movb    %ch, %dl  # NOREX
      movzbl    %dl, %ecx  # NOREX
      .loc    1 11 32                 # bz159663-min.cpp:11:32
!     cvtsi2ssl    %ecx, %xmm0
!     .loc    1 11 8                  # bz159663-min.cpp:11:8
      movq    -24(%rbp), %rdi         # 8-byte Reload
      callq    _ZN7Vector44setYEf
---------------
      .loc    1 11 33 is_stmt 1       # bz159663-min.cpp:11:33
      movl    -12(%rbp), %ecx
      .loc    1 11 45 is_stmt 0       # bz159663-min.cpp:11:45
      movb    %ch, %dl  # NOREX
      movzbl    %dl, %ecx  # NOREX
+     .loc    1 10 32 is_stmt 1       # bz159663-min.cpp:10:32
+                                         # implicit-def: %XMM0
      .loc    1 11 32                 # bz159663-min.cpp:11:32
!     vcvtsi2ssl    %ecx, %xmm0, %xmm0
!     .loc    1 11 8 is_stmt 0        # bz159663-min.cpp:11:8
      movq    -24(%rbp), %rdi         # 8-byte Reload
      callq    _ZN7Vector44setYEf
***************

What is it about AVX that introduces the spurious directive?</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>