From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6423 invoked by alias); 12 Oct 2007 20:54:32 -0000 Received: (qmail 6376 invoked by uid 48); 12 Oct 2007 20:54:20 -0000 Date: Fri, 12 Oct 2007 20:54:00 -0000 Message-ID: <20071012205420.6375.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/33759] Unequal character lengths in MERGE intrinsic not detected at run time 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: 2007-10/txt/msg01274.txt.bz2 ------- Comment #1 from burnus at gcc dot gnu dot org 2007-10-12 20:54 ------- > (1) transfer(string,"x",len(string)) is a rank one array of size 7 and should > not be assigned to an array of size 20. I think this is quite difficult to > detect at compile time, but it would be nice to have it at runtime. NAG f95 agrees with this and prints at run time: Rank 1 of array operand has extent 7 instead of 20 In UPPER, line 9 of test.f90 > (2) merge(tmp, string, .true.) try to merge a rank one character array with a > rank zero string. If this invalid and detected in the first test above, it > should also be detected in the function, unless I am missing something. I think the rank is not a problem as MERGE is an ELEMENTAL function and a scalar ("string") is conformable with any array (such as "tmp"). However, there is the problem that the string length is not the same (1 and 7); NAG f95 prints at run time: Differing character lengths (1 and 7) in MERGE In UPPER, line 10 of test.f90 -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- OtherBugsDependingO| |27766 nThis| | Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 GCC build triplet|powerpc-apple-darwin8 | GCC host triplet|powerpc-apple-darwin8 | GCC target triplet|powerpc-apple-darwin8 | Keywords| |diagnostic Last reconfirmed|0000-00-00 00:00:00 |2007-10-12 20:54:19 date| | Summary|Unequal character lengths in|Unequal character lengths in |MERGE intrinsic not detected|MERGE intrinsic not detected |in contained function. |at run time http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33759