[LLVMbugs] [Bug 21170] New: opt -O1 creates a file which output differs when run with lli -force-interpreter.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 6 08:59:06 PDT 2014


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

            Bug ID: 21170
           Summary: opt -O1 creates a file which output differs when run
                    with lli -force-interpreter.
           Product: new-bugs
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: karl.tarbe at cyber.ee
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13147
  --> http://llvm.org/bugs/attachment.cgi?id=13147&action=edit
Original program, that prints out some data.

I have a simple program in llvm IR, that prints out data in hex 24 values on a
row.

When I run it with
strace lli -force-interpreter=true print.ll > /tmp/file

The last lines of strace are:
lseek(1, 0, SEEK_CUR)                   = 0
fstat(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
write(1, "fa ff ff 7f bf fe ff ff 4f 00 00"..., 606) = 606
close(1)                                = 0
brk(0x1def000)                          = 0x1def000
exit_group(0)                           = ?
+++ exited with 0 +++

Now if I do: opt -O1 print.ll -o print.bc
and run that
strace lli -force-interpreter=true print.bc > /tmp/file

The last lines of strace are:
lseek(1, 0, SEEK_CUR)                   = 0
fstat(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
fstat(1, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x7feb8e3e5000
write(1, "fa ff ff 7f bf fe ff ff 4f 00 00"..., 597) = 597
close(1)                                = 0
brk(0x221b000)                          = 0x221b000
write(1, "\n\n\n\n\n\n\n\n\n", 9)       = -1 EBADF (Bad file descriptor)
exit_group(0)                           = ?
+++ exited with 0 +++

print.ll produces a correct file.
print.bc (*optimized variant) produces an incorrect file (no newline
characters).

And the problem does not appear when not forcing to use interpreter, or when
not redirecting the output to a file.

-- 
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/20141006/f3c40e39/attachment.html>


More information about the llvm-bugs mailing list