<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 --- - llc handles uitofp conversion incorrect. Linux, regression from version 3.4 to trunk"
href="http://llvm.org/bugs/show_bug.cgi?id=20394">20394</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>llc handles uitofp conversion incorrect. Linux, regression from version 3.4 to trunk
</td>
</tr>
<tr>
<th>Product</th>
<td>tools
</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>llc
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ili.filippov@gmail.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>We can make small reproducer:
p1.ll:
; ModuleID = 'p1.bc'
target datalayout =
"e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nounwind
define void @result(float* noalias %RET) {
allocas:
%pi = alloca <8 x i32>
store <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>, <8
x i32>* %pi
%pi_load = load <8 x i32>* %pi
%RRR = bitcast float* %RET to <8 x float>*
%bitop_to_float = uitofp <8 x i32> %pi_load to <8 x float>
store <8 x float> %bitop_to_float, <8 x float>* %RRR
ret void
}
t.cpp:
#include <stdio.h>
extern "C" {extern void result(float *val);}
int main(int argc, char *argv[]) {
float expected_result[8] __attribute__((aligned(64)));
result(expected_result);
printf("%f", expected_result[0]);
return 0;}
if we execute:
bin-3.4/bin/llc p1.ll -o 34.s
clang++ t.cpp 34.s
./a.out
we will have: 0.000000 and this is right.
however:
bin-trunk/bin/llc p1.ll -o trunk.s
clang++ t.cpp trunk.s
./a.out
we will have: 237684487542793012780631851008.000000 and this is wrong.</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>