------- Comment #7 from jv244 at cam dot ac dot uk  2010-04-26 11:06 -------
I have been trying to reduce more, but this is the smallest so far, seems like
it needs the derived types, the 2D arrays, the pointers. I've reduced this with
4.5.1, using '-O2 -funswitch-loops'

MODULE M1
  IMPLICIT NONE
  TYPE cp_fm_type
     REAL(KIND=4), DIMENSION(:,:), POINTER :: local_data_sp
     REAL(KIND=8), DIMENSION(:,:), POINTER :: local_data
  END TYPE
CONTAINS
  SUBROUTINE cp_fm_upper_to_full(matrix,nrow_global,ncol_global,use_sp)
    TYPE(cp_fm_type), POINTER          :: matrix
    INTEGER, INTENT(IN) :: ncol_global, nrow_global
    INTEGER :: irow_global, icol_global
    LOGICAL :: use_sp
    REAL(KIND = 4), DIMENSION(:,:), POINTER :: a_sp
    REAL(KIND = 8), DIMENSION(:,:), POINTER :: a

    a => matrix%local_data
    a_sp => matrix%local_data_sp
    DO irow_global=1,nrow_global
       DO icol_global=irow_global+1,ncol_global
          IF(use_sp) THEN
             a_sp(icol_global,irow_global)=a_sp(irow_global,icol_global)
          ELSE
             a(icol_global,irow_global)=a(irow_global,icol_global)
          ENDIF
       ENDDO
    ENDDO
  END SUBROUTINE cp_fm_upper_to_full
END MODULE M1

  USE M1
  TYPE(cp_fm_type), POINTER :: a
  INTEGER, PARAMETER :: N=17
  ALLOCATE(a)
  ALLOCATE(a%local_data(N,N))
  a%local_data=0
  CALL cp_fm_upper_to_full(a,N,N,.FALSE.)
END


-- 


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

Reply via email to