http://llvm.org/bugs/show_bug.cgi?id=8575
Summary: missing code cleanup after jump threading
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Keywords: quality-of-implementation
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
// Test case
int g;
void foo(int n, int m)
{
int r = 0;
if (n > m)
{
r = 1;
}
else {
r = 3;
}
if (r < 2)
{
g = r;
}
else
g = r+ 3;
}
// Clang -O2 -fomit-frame-pointer produces:
.Leh_func_begin0:
cmpl %esi, %edi
setle %al
movzbl %al, %eax
leal 1(%rax,%rax), %eax
jle .LBB0_2
movl %eax, g(%rip)
ret
.LBB0_2:
addl $3, %eax
movl %eax, g(%rip)
ret
.Ltmp0:
// Gcc -O2 produces:
.LFB0:
.cfi_startproc
xorl %eax, %eax
cmpl %esi, %edi
setle %al
leal 1(%rax,%rax,4), %eax
movl %eax, g(%rip)
ret
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs