From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5A915385801D; Mon, 22 Feb 2021 17:05:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A915385801D From: "gscfq@t-online.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/99125] [9/10/11 Regression] ICE: gimplification failed (gimplify.c:15068) Date: Mon, 22 Feb 2021 17:05:09 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gscfq@t-online.de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: pault at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.4 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, 22 Feb 2021 17:05:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99125 --- Comment #5 from G. Steinmetz --- I also checked this invalid (probably a known issue) : $ cat za.f90 program p character(:), allocatable :: a(:) character(8) :: c(2) =3D '12 45 78' a =3D c print *, a(7:8) end $ gfortran-11-20210221 za.f90 && ./a.out # surprising 12 45 7812 45 78 Detected at runtime : $ gfortran-11-20210221 za.f90 -Wall -fcheck=3Dall && ./a.out za.f90:2:36: 2 | character(:), allocatable :: a(:) | ^ Warning: '.a' may be used uninitialized [-Wmaybe-uninitialized] za.f90:4:8: 4 | a =3D c | ^ Warning: 'a.offset' may be used uninitialized [-Wmaybe-uninitialized] za.f90:2:36: 2 | character(:), allocatable :: a(:) | ^ note: 'a' declared here za.f90:4:8: 4 | a =3D c | ^ Warning: 'a.dim[0].lbound' may be used uninitialized [-Wmaybe-uninitialized] za.f90:2:36: 2 | character(:), allocatable :: a(:) | ^ note: 'a' declared here za.f90:4:8: 4 | a =3D c | ^ Warning: 'a.dim[0].ubound' may be used uninitialized [-Wmaybe-uninitialized] za.f90:2:36: 2 | character(:), allocatable :: a(:) | ^ note: 'a' declared here za.f90:4:8: 4 | a =3D c | ^ Warning: 'a.dim[0].lbound' may be used uninitialized [-Wmaybe-uninitialized] za.f90:2:36: 2 | character(:), allocatable :: a(:) | ^ note: 'a' declared here za.f90:4:8: 4 | a =3D c | ^ Warning: 'a.dim[0].ubound' may be used uninitialized [-Wmaybe-uninitialized] za.f90:2:36: 2 | character(:), allocatable :: a(:) | ^ note: 'a' declared here za.f90:4:8: 4 | a =3D c | ^ Warning: 'a.dim[0].ubound' may be used uninitialized [-Wmaybe-uninitialized] za.f90:2:36: 2 | character(:), allocatable :: a(:) | ^ note: 'a' declared here za.f90:4:8: 4 | a =3D c | ^ Warning: 'a.dim[0].lbound' may be used uninitialized [-Wmaybe-uninitialized] za.f90:2:36: 2 | character(:), allocatable :: a(:) | ^ note: 'a' declared here At line 5 of file za.f90 Fortran runtime error: Index '7' of dimension 1 of array 'a' outside of expected range (1:2) Error termination. Backtrace: #0 0x4025d1 in ??? #1 0x402738 in ??? #2 0x7fa0f5697f89 in ??? #3 0x4022b9 in ??? at ../sysdeps/x86_64/start.S:120 #4 0xffffffffffffffff in ??? --- The very basic simplification gives : $ cat zc.f90 program p character(8) :: c(2) =3D '12 45 78' print *, c(7:8) end $ gfortran-11-20210221 zc.f90 -Wall -fcheck=3Dall && ./a.out zc.f90:3:14: 3 | print *, c(7:8) | 1 Warning: Lower array reference at (1) is out of bounds (7 > 2) in dimension= 1 At line 3 of file zc.f90 Fortran runtime error: Index '7' of dimension 1 of array 'c' outside of expected range (1:2) Error termination. Backtrace: #0 0x4023f7 in ??? #1 0x40242b in ??? #2 0x7fc15fc2af89 in ??? #3 0x4022b9 in ??? at ../sysdeps/x86_64/start.S:120 #4 0xffffffffffffffff in ???=