<html>
    <head>
      <base href="http://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 --- - Location list is not being generated"
   href="http://llvm.org/bugs/show_bug.cgi?id=21881">21881</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Location list is not being generated
          </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: PowerPC
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>katya_romanova@playstation.sony.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I fixed PR21176 and submitted a fix for it in r223981. However, buildbot's
testing failed for ppc64 platform on the new test that I added. 

I reverted my fix completely in r224000, but I'm planning to put the fix back
shortly with XFAIL condition for ppc64.

My test failed for PowerPC because a location list for a variable is not being
generated, where expected.

Consider the following testcase:

----------------------
extern int func();

int main()
{
   volatile int c = 13;
   c = func();
   return c;
}
----------------------

PPC: 

 llc -mtriple=powerpc64-unknown-linux test.ll  -O2  -dwarf-version 2
-filetype=obj

For PPC DWARF Location lists are not generated and variable 'c' has to
DW_AT_const_value (13).  

0x0000004f:     DW_TAG_variable [3]
                  DW_AT_const_value [DW_FORM_sdata]     (13)
                  DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000068] = "c")
                  DW_AT_decl_file [DW_FORM_data1]       ("test.cpp")
                  DW_AT_decl_line [DW_FORM_data1]       (4)
                  DW_AT_type [DW_FORM_ref4]     (cu + 0x0063 => {0x00000063})


X86_64:

All other LLVM supported targets generate a location list; 
Die for variable 'c' contains DW_AT_location attribute.

llc -mtriple=x86_64-unknown-linux test.ll  -O2  -dwarf-version 2 -filetype=obj

0x0000004f:     DW_TAG_variable [3]
                  DW_AT_location [DW_FORM_data4]        (0x00000000)
                  DW_AT_name [DW_FORM_strp]     ( .debug_str[0x00000068] = "c")
                  DW_AT_decl_file [DW_FORM_data1]       ("test.cpp")
                  DW_AT_decl_line [DW_FORM_data1]       (4)
                  DW_AT_type [DW_FORM_ref4]     (cu + 0x0066 => {0x00000066})



.debug_loc contents:
0x00000000: Beginning address offset: 0x0000000000000001
               Ending address offset: 0x000000000000000e
                Location description: 10 0d

            Beginning address offset: 0x000000000000000e
               Ending address offset: 0x0000000000000016
                Location description: 50 93 04</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>