This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/80132] New: powerpc: irrelevant register move before operation
- From: "christophe dot leroy at c-s dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Mar 2017 14:16:04 +0000
- Subject: [Bug c/80132] New: powerpc: irrelevant register move before operation
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80132
Bug ID: 80132
Summary: powerpc: irrelevant register move before operation
Product: gcc
Version: 5.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: christophe.leroy@c-s.fr
Target Milestone: ---
In the function below, the two first 'mr' instructions are unneeded, the loop
should operate directly with r5 and r6
void memset64(long long *p, long long v, unsigned int c)
{
int i;
for (i = 0; i < c; i++)
*p++ = v;
}
test2.o: file format elf32-powerpc
Disassembly of section .text:
0000001c <memset64>:
1c: 2c 07 00 00 cmpwi r7,0
20: 7c cb 33 78 mr r11,r6
24: 7c aa 2b 78 mr r10,r5
28: 38 63 ff f8 addi r3,r3,-8
2c: 4d 82 00 20 beqlr
30: 7c e9 03 a6 mtctr r7
34: 95 43 00 08 stwu r10,8(r3)
38: 91 63 00 04 stw r11,4(r3)
3c: 42 00 ff f8 bdnz 34 <memset64+0x18>
40: 4e 80 00 20 blr