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/31016] Use __buildin_memcpy and __memcpy for array assignment



------- Comment #1 from burnus at gcc dot gnu dot org  2007-03-01 19:15 -------
subroutine bar(a,b,n)
 implicit none
 integer :: n
 real :: a(n,n), b(n,n)
 a = b
end subroutine

For that example example, the overhead is even more obvious. One needs to run
only:

for (int i = 0; i < n*n; i++)
  a[i] = b[i]

However, gfortran generates two loops and a whole stack of temporary variables.

Analogously for

subroutine bar(a,n)
 implicit none
 integer :: n
 real :: a(n,n)
 a = 12
end subroutine


-- 


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


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