From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 712663891C30; Sun, 30 May 2021 17:04:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 712663891C30 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/94331] Bind(C) corrupts array descriptors Date: Sun, 30 May 2021 17:04:03 +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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jrfsousa at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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: Sun, 30 May 2021 17:04:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94331 Dominique d'Humieres changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |ASSIGNED --- Comment #7 from Dominique d'Humieres --- > Patch posted: > > https://gcc.gnu.org/pipermail/fortran/2021-May/056054.html With the patch the test PR94331.f90 fails with -flto: % gfc /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.f90 /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c -flto /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.f90:121:10: warning: type of 'checkb_o_ar' does not match original declaration [-Wlto-type-mismatch] 121 | if(.not.checkb_o_ar(a, 0, ex-1))stop 28 | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type mismatch= in parameter 2 38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t l= b, const CFI_index_t ub) | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type 'CFI_index_t' should match type 'int' /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.f90:111:10: warning: type of 'checkb_o_as' does not match original declaration [-Wlto-type-mismatch] 111 | if(.not.checkb_o_as(a, 0, ex-1))stop 20 | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type mismatch= in parameter 2 38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t l= b, const CFI_index_t ub) | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type 'CFI_index_t' should match type 'int' /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.f90:101:10: warning: type of 'checkb_p_ar' does not match original declaration [-Wlto-type-mismatch] 101 | if(.not.checkb_p_ar(a, lb, ub)) stop 12 | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type mismatch= in parameter 2 38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t l= b, const CFI_index_t ub) | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type 'CFI_index_t' should match type 'int' /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.f90:91:10: warning: type of 'checkb_p_as' does not match original declaration [-Wlto-type-mismatch] 91 | if(.not.checkb_p_as(a, lb, ub)) stop 4 | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type mismatch= in parameter 2 38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t l= b, const CFI_index_t ub) | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type 'CFI_index_t' should match type 'int' /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.f90:167:10: warning: type of 'checkb_a_ar' does not match original declaration [-Wlto-type-mismatch] 167 | if(.not.checkb_a_ar(b, lb, ub)) stop 63 | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type mismatch= in parameter 2 38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t l= b, const CFI_index_t ub) | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type 'CFI_index_t' should match type 'int' /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.f90:155:10: warning: type of 'checkb_a_as' does not match original declaration [-Wlto-type-mismatch] 155 | if(.not.checkb_a_as(b, lb, ub)) stop 54 | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type mismatch= in parameter 2 38 | check_bounds (const CFI_cdesc_t *restrict auxp, const CFI_index_t l= b, const CFI_index_t ub) | ^ /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: type 'CFI_index_t' should match type 'int' /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: 'check_bounds' was previously declared here /opt/gcc/work/gcc/testsuite/gfortran.dg/PR94331.c:38:1: note: code may be misoptimized unless '-fno-strict-aliasing' is used Note that the original test seems fixed even with -flto.=