http://llvm.org/bugs/show_bug.cgi?id=9961
Summary: missing simple store merging
Product: new-bugs
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
I wrote the equivalent to this sequence in a function:
void test(char *ptr) {
ptr[0] = 0;
ptr[1] = 0;
}
and was surprised to see that at -O2, we emit two movb instructions:
movb $0, (%rdi)
movb $0, 1(%rdi)
ret
I was really expecting a single movw. Now, gcc 4.5.2 does the exact same thing,
so maybe there's a good reason for this? It sure looks like a missed optz'n to
me.
On x86-32, four ptr[x] = 0 lines will merge into a single movl in llvm but not
in gcc. It doesn't happen in x86-64.
--
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