<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 - possible missed optimization for dead code elimination"
href="https://bugs.llvm.org/show_bug.cgi?id=49457">49457</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>possible missed optimization for dead code elimination
</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>Interprocedural Optimizations
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>zhendong.su@inf.ethz.ch
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>[562] % clangtk -v
clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
93afc3452cd4ebdb145e309f4d82f82e2f496479)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /local/suz-local/opfuzz/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.5.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
[563] %
[563] % clangtk -O3 -S small.c
[564] %
[564] % cat small.c
extern void foo(void);
struct {
int a;
int b;
} c, d;
int main() {
int *e = &d.b;
if ((int *)&c == e)
foo();
return 0;
}
[565] %
[565] % cat small.s
.text
.file "small.c"
.globl main # -- Begin function main
.p2align 4, 0x90
.type main,@function
main: # @main
.cfi_startproc
# %bb.0: # %entry
movl $c, %eax
cmpq $d+4, %rax
jne .LBB0_2
# %bb.1: # %if.then
pushq %rax
.cfi_def_cfa_offset 16
callq foo
addq $8, %rsp
.cfi_def_cfa_offset 8
.LBB0_2: # %if.end
xorl %eax, %eax
retq
.Lfunc_end0:
.size main, .Lfunc_end0-main
.cfi_endproc
# -- End function
.type d,@object # @d
.bss
.globl d
.p2align 2
d:
.zero 8
.size d, 8
.type c,@object # @c
.globl c
.p2align 2
c:
.zero 8
.size c, 8
.ident "clang version 13.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
93afc3452cd4ebdb145e309f4d82f82e2f496479)"
.section ".note.GNU-stack","",@progbits
.addrsig
.addrsig_sym d
.addrsig_sym c</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>