This is the mail archive of the gcc-patches@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] |
In the case of an INTENT(INOUT) argument, the original data has to be packed and copied to the temporary. I have signalled a TODO here; the potential creation of two temporaries could be eliminated and this is something that I intend to contribute after I have fixed the array TRANSFER intrinsic. This will require a new library routine that can be employed here. In the mean time, this patch works correctly (I hope!), even if it is a bit inefficient in a small number of cases.
+! Check an INTENT(INOUT) case + call nonassign (x, x((/2,3,1,4,5,6/))) + if (any(x%x .ne. (/-96000, 7200, -48000, -24, -480, 6000000/))) call abort () +! ...and again + call nonassign (x(2:3), x(1:2)) + if (any(x%x .ne. (/-96000, 288000, -21600, -24, -480, 6000000/))) call abort () +contains + elemental subroutine nonassign(x,y) + type(mytype), intent(INout) :: x + type(mytype), intent(in) :: y +! Change the sign according to the input, to verify that INOUT is working. + if (x%x > 20000) then + x%x = y%x*3 + else + x%x = -y%x*3 + end if + end subroutine nonassign +end program test
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |