This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/17064] -falias-noargument-global doesn't eliminate dead stores/loads
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Mar 2005 03:41:54 -0000
- Subject: [Bug tree-optimization/17064] -falias-noargument-global doesn't eliminate dead stores/loads
- References: <20040817140542.17064.pbrook@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-03-04 03:41 -------
Here is a testcase which we semi optimize on the RTL level but not at the tree level:
sum cannot alias a or b at all because of the default option for gfortran.
subroutine dot_product (sum, a, b, n)
real*8 a(n), b(n), sum
sum = 0
do i = 1, n
sum = sum + a (i) * b(i)
end do
end
The reason why I say semi is because there is an extra fmr (PPC):
The loop looks like:
L4:
lfd f13,0(r4)
addi r4,r4,8
lfd f0,0(r5)
addi r5,r5,8
fmadd f0,f13,f0,f12
fmr f12,f0
bdnz L4
If we had optimizate it at the tree level it would look like:
L4:
lfd f13,0(r4)
addi r4,r4,8
lfd f0,0(r5)
addi r5,r5,8
fmadd f12,f13,f0,f12
bdnz L4
Note how we don't have the extra fmr.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17064