This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/41494] New: temp and memcpy used when zeroing array


The following is causing a 7% degradation on cpu2000 benchmark 191.fma3d. The
problem was introduced somewhere between revisions 151544 and 151586.

Compile the following with -m32 -O2.

      MODULE force_                                                     

      TYPE :: force_type                                                
        REAL(KIND(0D0))  Xext    ! X direction external force              
        REAL(KIND(0D0))  Yext    ! Y direction external force              
        REAL(KIND(0D0))  Zext    ! Z direction external force              
        REAL(KIND(0D0))  Xint    ! X direction internal force              
        REAL(KIND(0D0))  Yint    ! Y direction internal force              
        REAL(KIND(0D0))  Zint    ! Z direction internal force              
      END TYPE                                                          

      TYPE (force_type), DIMENSION(:), ALLOCATABLE :: FORCE             
      INTEGER  NUMRT

      END MODULE force_


      SUBROUTINE SOLVE

        USE force_

      DO i = 1,NUMRT
        FORCE(i) = force_type (0,0,0,0,0,0)
      ENDDO

      END


The latter revision now zeroes out a temp and uses that as the source on a
memcpy call.


rev 151544:

.L3:
        stfd 0,0(9)
        stfd 0,8(9)
        stfd 0,16(9)
        stfd 0,24(9)
        stfd 0,32(9)
        stfd 0,40(9)
        addi 9,9,48
        bdnz .L3



rev 151586:

.L3:
        mr 3,30
        mr 4,28
        stfd 31,8(1)
        stfd 31,16(1)
        li 5,48
        addi 31,31,1
        stfd 31,24(1)
        stfd 31,32(1)
        stfd 31,40(1)
        stfd 31,48(1)
        bl memcpy
        cmpw 7,31,29
        addi 30,30,48
        bne 7,.L3


-- 
           Summary: temp and memcpy used when zeroing array
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pthaugen at gcc dot gnu dot org
 GCC build triplet: powerpc64-linux
  GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41494


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]