From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 67A3F3858C42; Sat, 30 Dec 2023 19:35:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 67A3F3858C42 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703964958; bh=tV/KNihzKhbRC9vmXX2vjprtXqBrxuR13IDr5mOcVJM=; h=From:To:Subject:Date:From; b=NnZtAxdyezqpVe84U3bgOOixlLSt6GzB4NQZY2+braoSkUQQIHH3p1Wsv4kyMxR/X j/EhA9/oazAMcwd6C2KVhk9EA7sBkhBuxyF8CK+gON9N6g9BVSDRK2JEI/VgyLio/u 0P1Z7dIp9P0Bd3RNLP8j/0tA4xc2wxVsfIgv9A08= From: "sebunger44 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug lto/113183] New: LTO crashes with Segmentation fault Date: Sat, 30 Dec 2023 19:35:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: lto X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sebunger44 at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone attachments.created Message-ID: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113183 Bug ID: 113183 Summary: LTO crashes with Segmentation fault Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: sebunger44 at gmail dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Created attachment 56968 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D56968&action=3Dedit Contains the LD and CPP files I'm in the process of creating a tool-chain and porting FreeRTOS to our Leo= n2 based platform and ran into this with GCC 13.2. However, after reducing it = to a near trivial example, I can now also reproduce it on GCC 11.4 as shipped by Ubuntu 22.04. So it probably has nothing to do with how I compiled my GCC = etc. Output: $ gcc -nostartfiles -O2 -flto -T link.ld tt.cpp -o tt =E2=80=98 Segmentation fault 0x7f23ac64251f ??? ./signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0x7f23ac629d8f __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 0x7f23ac629e3f __libc_start_main_impl ../csu/libc-start.c:392 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. lto-wrapper: fatal error: gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status Note that I do not expect this example to run in any way. I have cut out all the target specific stuff so only plain old C++ remained.=