From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 478B9385AC0A; Sun, 17 Jul 2022 19:26:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 478B9385AC0A From: "anlauf at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/106331] [12/13 Regression] Whole array assignment of empty string segfaults with -Og Date: Sun, 17 Jul 2022 19:26:21 +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.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anlauf 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: 12.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: short_desc cf_reconfirmed_on cc bug_status everconfirmed target_milestone cf_known_to_work cf_known_to_fail 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, 17 Jul 2022 19:26:21 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106331 anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Whole array assignment of |[12/13 Regression] Whole |empty string segfaults with |array assignment of empty |-Og |string segfaults with -Og Last reconfirmed| |2022-07-17 CC| |anlauf at gcc dot gnu.org Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Target Milestone|--- |12.2 Known to work| |11.3.1 Known to fail| |12.1.1 --- Comment #1 from anlauf at gcc dot gnu.org --- Confirmed on x86_64-pc-linux-gnu with -m64 for character length 17 to 31. For -m32 the issue does not show up, at least for the character length valu= es I tried. Note however that replacing the array assignment a =3D '' by an explicit loop do i =3D 1,2 a(i) =3D '' end do does not change the behavior of the reproducer. valgrind a.out says: Program received signal SIGSEGV: Segmentation fault - invalid memory refere= nce. Backtrace for this error: #0 0x5b0fd6f in ??? #1 0x4005e7 in ??? #2 0x40061f in ??? #3 0x5afa2bc in ??? #4 0x400519 in ??? #5 0xffffffffffffffff in ??? =3D=3D14463=3D=3D=20 =3D=3D14463=3D=3D Process terminating with default action of signal 11 (SIG= SEGV): dumping core =3D=3D14463=3D=3D at 0x5B0FCB9: raise (in /lib64/libc-2.31.so) =3D=3D14463=3D=3D by 0x5B0FD6F: ??? (in /lib64/libc-2.31.so) =3D=3D14463=3D=3D by 0x4005E6: MAIN__ (in /home/anlauf/gcc-bugs/a.out) =3D=3D14463=3D=3D by 0x40061F: main (in /home/anlauf/gcc-bugs/a.out) I have no idea what is going on here...=