<html>
<head>
<base href="https://bugs.llvm.org/">
</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 - Supoptimal jumps in code generation"
href="https://bugs.llvm.org/show_bug.cgi?id=37511">37511</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Supoptimal jumps in code generation
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</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>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Common Code Generator Code
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>david.bolvansky@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>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>
<span class="quote">>::~basic_filebuf()</span >
jmp .LBB0_17
mov r15, rax ******
.LBB0_17:
...
Godbolt link: <a href="https://godbolt.org/g/iSAZxM">https://godbolt.org/g/iSAZxM</a> (lines 70 - 80)</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>