From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 008AF3858415; Mon, 3 Jan 2022 16:48:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 008AF3858415 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/103390] [12 Regression] ICE: gimplification failed since r12-4591-g1af78e731feb9327 Date: Mon, 03 Jan 2022 16:48:18 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: sandra at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Mon, 03 Jan 2022 16:48:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103390 --- Comment #8 from CVS Commits --- The master branch has been updated by Sandra Loosemore : https://gcc.gnu.org/g:6447f6f983ffeaecb8753ef685d702bf2594968b commit r12-6191-g6447f6f983ffeaecb8753ef685d702bf2594968b Author: Sandra Loosemore Date: Mon Jan 3 08:47:38 2022 -0800 Fortran: Fix array copy-in/copy-out for BIND(C) functions [PR103390] The Fortran front end was generating invalid code for the array copy-out after a call to a BIND(C) function for a dummy with the CONTIGUOUS attribute when the actual argument was a call to the SHAPE intrinsic or other array expressions that are not lvalues. It was also generating code to evaluate the argument expression multiple times on copy-in. This patch teaches it to recognize that a copy is not needed in these cases. 2022-01-03 Sandra Loosemore PR fortran/103390 gcc/fortran/ * expr.c (gfc_is_simply_contiguous): Make it smarter about function calls. * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Do not generate copy loops for array expressions that are not "variables" (lvalues). gcc/testsuite/ * gfortran.dg/c-interop/pr103390-1.f90: New. * gfortran.dg/c-interop/pr103390-2.f90: New. * gfortran.dg/c-interop/pr103390-3.f90: New. * gfortran.dg/c-interop/pr103390-4.f90: New. * gfortran.dg/c-interop/pr103390-6.f90: New. * gfortran.dg/c-interop/pr103390-7.f90: New. * gfortran.dg/c-interop/pr103390-8.f90: New. * gfortran.dg/c-interop/pr103390-9.f90: New.=