[LLVMbugs] [Bug 21006] New: inconsistent line number information with unsigned 64-bit int conversion to double
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Sep 19 12:55:23 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=21006
Bug ID: 21006
Summary: inconsistent line number information with unsigned
64-bit int conversion to double
Product: libraries
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
Assignee: unassignedbugs at nondot.org
Reporter: Wolfgang_Pieb at playstation.sony.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Created attachment 13054
--> http://llvm.org/bugs/attachment.cgi?id=13054&action=edit
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
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140919/038ba9fa/attachment.html>
More information about the llvm-bugs
mailing list