<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 --- - inconsistent line number information with unsigned 64-bit int conversion to double"
   href="http://llvm.org/bugs/show_bug.cgi?id=21006">21006</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>inconsistent line number information with unsigned 64-bit int conversion to double
          </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>Windows NT
          </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>Wolfgang_Pieb@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>Created <span class=""><a href="attachment.cgi?id=13054" name="attach_13054" title="corresponding IR input">attachment 13054</a> <a href="attachment.cgi?id=13054&action=edit" title="corresponding IR input">[details]</a></span>
corresponding IR input

When two or more conversions of unsigned64-bit integer to 'double' 
floating-point are done "near" each other (in the same basic
block, in our experiments), instructions with line numbers for the two
conversions are interspersed with each other causing stepping in the debugger
to jump back and forth between the two conversions.

This happens at -O0 -g and occurs at r218128.

The following source file illustrates this. I am attaching a .ll file, 
generated by clang with -emit-llvm -S, which can be compiled with 
llc -O0.

    ---------------------------------------------------------------------
    extern "C" int printf(const char *, ...);
    void bar()
    {
      printf("bar() invoked\n");
    }

    // Change 'fp_t' to 'float', or 'int_t' to 'unsigned int' (or
    // 'signed long'), and the problem doesn't happen:
    typedef double          fp_t;
    typedef unsigned long   int_t;

    int_t glb_start      = 17;
    int_t glb_end        = 42;

    int main()
    {
    /*17*/ int_t start = glb_start;
    /*18*/ int_t end   = glb_end;

    /*20*/ fp_t dbl_start = (fp_t) start;
    /*21*/ bar();
    /*22*/ fp_t dbl_end   = (fp_t) end;

    /*24*/ printf("dbl_start = %f, dbl_end = %f\n", dbl_start, dbl_end);
    /*25*/ return 0;
    }
    ---------------------------------------------------------------------

dwarfdump -l output when compiled to a .o file:

        0x00000030  [  16, 0] NS
        0x00000049  [  17, 8] NS PE
        0x00000054  [  18, 8] NS
 ==>    0x0000005f  [  20, 8] NS
 ==>    0x00000064  [  22, 8] NS
 ==>    0x0000006b  [  20, 8] NS
 ==>    0x0000006f  [  22, 8] NS
 ==>    0x00000077  [  20, 8] NS
 ==>    0x00000089  [  21, 8] NS
 ==>    0x0000009a  [  22, 8] NS
        0x000000bd  [  24, 8] NS
        0x000000d4  [  25, 8] NS
        0x000000df  [  25, 8] NS ET

So stepping through the code in the debugger takes the following sequence:
        line 20, 22, 20, 22, 20, 21, 22</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>