------- 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

Reply via email to