This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/29952] Flag to give runtime information " array temporary was created for argument"
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jul 2008 16:12:20 -0000
- Subject: [Bug fortran/29952] Flag to give runtime information " array temporary was created for argument"
- References: <bug-29952-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from burnus at gcc dot gnu dot org 2008-07-23 16:12 -------
Test case for the run-time check. Only for the second call a warning is needed.
One way to add it is the following. One simply inserts
if (parm.1.data != D.1036)
printf("test.f90:5: In call to FOO, an array temporary "
"was created for argument #1\n");
between the following lines:
D.1036 = _gfortran_internal_pack (&parm.1);
foo (D.1036);
(The "if" line is copied from the _gfortran_internal_unpack block.)
Test case:
program test
implicit none
integer :: a(3,3)
call foo(a(:,1)) ! OK, no temporary created
call foo(a(1,:)) ! BAD, temporary var created
contains
subroutine foo(x)
integer :: x(3)
x = 5
end subroutine foo
end program test
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29952