[LLVMbugs] [Bug 20394] New: llc handles uitofp conversion incorrect. Linux, regression from version 3.4 to trunk

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jul 22 01:18:24 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20394

            Bug ID: 20394
           Summary: llc handles uitofp conversion incorrect. Linux,
                    regression from version 3.4 to trunk
           Product: tools
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
          Assignee: unassignedbugs at nondot.org
          Reporter: ili.filippov at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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.

-- 
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/20140722/b04b9015/attachment.html>


More information about the llvm-bugs mailing list