<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Some variables have no dwarf location when -fast-isel is disabled on thumb targets"
   href="https://bugs.llvm.org/show_bug.cgi?id=33044">33044</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Some variables have no dwarf location when -fast-isel is disabled on thumb targets
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>DebugInfo
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>francisjricci@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>To reproduce:

=== Objective-C Testcase ===
@class NSString;

void foo()
{
  NSString* t = @"foo";
  NSString* s = @"bar";
}
===========================

Compile with:

clang -cc1 -triple thumbv7-apple-ios9.0 -debug-info-kind=limited
-fsanitize=address -fobjc-arc -fobjc-runtime=ios -mllvm -fast-isel=0 test.m
-emit-obj -o test.o

clang -cc1 -triple thumbv7-apple-ios9.0 -debug-info-kind=limited
-fsanitize=address -fobjc-arc -fobjc-runtime=ios -mllvm -fast-isel=1 test.m
-emit-obj -o test.fast-isel.o

Compare dwarf for variable "s":

llvm-dwarfdump test.o:
0x00000048:     DW_TAG_variable [4]
                  DW_AT_name [DW_FORM_strp]     ( .debug_str[0x000000e1] = "s")
                  DW_AT_decl_file [DW_FORM_data1]       ("test.m")
                  DW_AT_decl_line [DW_FORM_data1]       (6)
                  DW_AT_type [DW_FORM_ref4]     (cu + 0x0054 => {0x00000054})

llvm-dwarfdump test.fast-isel.o:
0x00000048:     DW_TAG_variable [3]
                  DW_AT_location [DW_FORM_sec_offset]   (0x00000021)
                  DW_AT_name [DW_FORM_strp]     ( .debug_str[0x000000e1] = "s")
                  DW_AT_decl_file [DW_FORM_data1]       ("test.m")
                  DW_AT_decl_line [DW_FORM_data1]       (6)
                  DW_AT_type [DW_FORM_ref4]     (cu + 0x0058 => {0x00000058})

0x00000021: Beginning address offset: 0x00000000000000b8
               Ending address offset: 0x00000000000000c2
                Location description: 75 00

            Beginning address offset: 0x00000000000000c2
               Ending address offset: 0x00000000000001a6
                Location description: 76 28 06</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>