From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10325 invoked by alias); 26 Jun 2013 14:43:34 -0000 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 Received: (qmail 10297 invoked by uid 48); 26 Jun 2013 14:43:31 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57711] Accepts non-matching invalid dummy procedure as actual argument Date: Wed, 26 Jun 2013 14:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.7.2 X-Bugzilla-Keywords: accepts-invalid, diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-06/txt/msg01591.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57711 --- Comment #5 from Tobias Burnus --- (In reply to Dmitry Kabanov from comment #4) > Regarding the bug in JAC/DUMMY_JAC: I think for one-dimensional arrays there > is no difference between ASSUMED-SIZE and ASSUMED-SHAPE. That's wrong: - Assumed-size ("var(*)", "var(5,*)") and explicit size ("var(2,3)", "var(n,m)" [the latter: automatic arrays]) pass a pointer to the data. - Assumed-shape and deferred-shape ("var(:)") [and assumed-rank] pass a pointer to an array descriptor (dope vector), which contains the array bounds - and a pointer to the data. Thus, mixing arrays from the first group with arrays from the second group does not work. Thus, for procedures passed as argument (as your (dummy_)jac) the array type has to be the same. And for normal array arguments, the compiler has to know the interface* - otherwise it assumes that it is in the first group. For array arguments, the compiler automatically converts between the two groups. (* know = its in a MODULE, in an internal procedure ("contains") or in an INTERFACE block.) > Anyway, the code compiles with gfortran 4.6.3. My point was that they have a different internal representation. Thus, it will fail at run time as soon as you access the array - either by having the wrong value or by crashing. Hence, you really should ensure that DUMMY_JAC and JAC either use both assumed-shape arrays - or both assumed-size/explicit-size. (Mixing the latter is fine in practice [if the compiler doesn't complain], even if it is not permitted by the standard.) If you corrected that bug, it should compile with both GCC 4.6 and GCC 4.7. > I haven't found in press release of 4.7 any > info confirming that gfortran changed its behavior regarding that matter > intentionally. Is there any way to list all tasks which were included in > some particular version of gfortran? That change falls into the category bug fix/diagnostic improvement. The release notes only list major, user visible changes: http://gcc.gnu.org/gcc-4.7/changes.html All changes are in the ChangeLog files. For the Fortran front end (w/o library changes), you can find them at http://gcc.gnu.org/viewcvs/gcc/trunk/gcc/fortran/ for the current development version - and for GCC 4.7 at http://gcc.gnu.org/viewcvs/gcc/branches/gcc-4_7-branch/gcc/fortran/