From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23885 invoked by alias); 23 Jul 2008 16:13:07 -0000 Received: (qmail 22674 invoked by uid 48); 23 Jul 2008 16:12:20 -0000 Date: Wed, 23 Jul 2008 16:13:00 -0000 Message-ID: <20080723161220.22673.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/29952] Flag to give runtime information " array temporary was created for argument" In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-07/txt/msg01801.txt.bz2 ------- 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