This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/36770] PowerPC generated PTR code inefficiency
- From: "gunnar at greyhound-data dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2008 09:18:52 -0000
- Subject: [Bug middle-end/36770] PowerPC generated PTR code inefficiency
- References: <bug-36770-16150@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from gunnar at greyhound-data dot com 2008-07-10 09:18 -------
(In reply to comment #1)
> forward-propagate is causing some of the issues as shown by:
> int *test2(int *a ){
> a[1]=a[0];
> a++;
> return a;
> }
Your example creates the following ASM code:
test2:
mr 9,3
addi 3,3,4
lwz 0,0(9)
stw 0,4(9)
blr
Correct would be:
test2:
lwz 0,0(3)
stwu 0,4(3)
blr
Is you can see the created bad code is just the same.
This is independent of the register pinning.
Can I understand you comment a verification that the forward propagation is
broken in GCC/PPC?
Kind regards
Gunnar von Boehn
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36770