From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 57F67385840A; Tue, 31 Aug 2021 10:52:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57F67385840A From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/92482] BIND(C) with array-descriptor mishandled for type character Date: Tue, 31 Aug 2021 10:52:26 +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: 10.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: cf_reconfirmed_on everconfirmed bug_status Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2021 10:52:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D92482 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-08-31 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #6 from Tobias Burnus --- With my bind-C array descriptor patch, all tests except of=20 strg_print_2("abc"). (To be submitted; I will include this testcase as gfortran.dg/bind-c-char-descr.f90 with the failing test commented.) The still FAILING testcase does *not* use BIND(C) - and only TYPE(*) with assumed-rank:=20 That test passes this string to a gfortran array descriptor for type: type(*), target, intent(in) :: this(..) which is then c_f_pointer(c_loc(this), strn) to a Fortran pointer. The call has: scalar.4 =3D 97; // that's 'a' -> expected: "abc". desc.3.dtype =3D {.elem_len=3D1, .rank=3D0, .type=3D1}; // not the elem= _len=3D1; should be len*kind desc.3.data =3D (void *) &scalar.4; desc.3.span =3D (integer(kind=3D8)) desc.3.dtype.elem_len;=