<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 - -Og should not merge functions calls because it drops line number information"
href="https://bugs.llvm.org/show_bug.cgi?id=42878">42878</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Og should not merge functions calls because it drops line number information
</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>All
</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>Scalar Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>jmuizelaar@mozilla.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Compiling the following code with: clang -g -Og -S -emit-llvm test.c
void crash() __attribute__((noreturn));
void f(int i) {
if (i == 3) {
crash();
}
crash();
}
gives:
; Function Attrs: noreturn nounwind ssp uwtable
define void @f(i32) local_unnamed_addr #0 !dbg !8 {
call void @llvm.dbg.value(metadata i32 %0, metadata !13, metadata
!DIExpression()), !dbg !14
tail call void (...) @crash() #3, !dbg !15
unreachable, !dbg !16
}
with a line number of 0
!15 = !DILocation(line: 0, scope: !8)
LLVM should not merge calls to crash() when doing -Og because it means that the
call to crash() looses it's line number information and makes debugging quite
unpleasant.
The same problem also happens with something like:
void crash();
void f(int i) {
if (i == 3) {
crash();
} else {
crash();
}
}
GCC's -Og does not have this problem.</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>