https://bugs.llvm.org/show_bug.cgi?id=37511
Bug ID: 37511
Summary: Supoptimal jumps in code generation
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Common Code Generator Code
Assignee: unassignedb...@nondot.org
Reporter: david.bolvan...@gmail.com
CC: llvm-bugs@lists.llvm.org
Hello,
code:
int main () {
std::ifstream is ("test.txt", std::ifstream::binary);
if (is) {
// get length of file:
is.seekg (0, is.end);
int length = is.tellg();
is.seekg (0, is.beg);
}
return 0;
}
clang++ -O3 -stdlib=libc++
Lines with **** look strange for me.
X86 ASM:
...
pop r15
ret
jmp .LBB0_15 ******
.LBB0_15:
mov r15, rax
mov qword ptr [rsp], offset vtable for std::__1::basic_ifstream<char,
std::__1::char_traits<char> >+24
mov qword ptr [rsp + 184], offset vtable for std::__1::basic_ifstream<char,
std::__1::char_traits<char> >+64
jmp .LBB0_16
mov r15, rax ******
.LBB0_16:
mov rdi, rbx
call std::__1::basic_filebuf<char, std::__1::char_traits<char>
>::~basic_filebuf()
jmp .LBB0_17
mov r15, rax ******
.LBB0_17:
...
Godbolt link: https://godbolt.org/g/iSAZxM (lines 70 - 80)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs