From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E3FEC3858D3C; Sat, 20 Jan 2024 09:04:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3FEC3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705741459; bh=GZ1lJHcKWtxBe67oKQwekhfVz2s+Vzbpp0qoIRJaH6I=; h=From:To:Subject:Date:From; b=OXx6NMNrNHCjpImV4fk7hA1eb4793D0U6Gnkt5/P6x1s3hLUfdd7SAvrOIYxheuz3 vaGf+0UPruW/ZLCdBMZEy60cUJxN61dh5DYW1xy6SPCqgdi11DwrrhGuWm31CW7cIU +7ddqLVNv54GfYUrBcRoXA0KztTgfT2TS+Fp9c+s= From: "sjames at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113521] New: ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg Date: Sat, 20 Jan 2024 09:04:19 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sjames at gcc dot gnu.org 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 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=3D113521 Bug ID: 113521 Summary: ICE when building swi-prolog-9.1.2 with LTO in verify_gimple_in_cfg Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: sjames at gcc dot gnu.org CC: arsen at gcc dot gnu.org Target Milestone: --- Trying again - PR113520 was my first reduction for this but ended up being a different problem. ICE when building swi-prolog-9.1.2 with LTO. object.c.i: ``` extern int builtin_names[]; void vm_send(); void freeObject() { vm_send(0, &builtin_names[6]); } ``` passing.c.i: ``` typedef void *Any; int *vm_send_g_0; void assignField(); void pceExecuteGoal() { assignField(); } void vm_send(Any, int *selector, Any) { vm_send_g_0 =3D selector; } ``` self.c.i: ``` struct { } builtin_names[]; __attribute__((visibility("hidden"))) void vm_send() {} ``` ``` $ gcc -O2 -flto object.c.i passing.c.i self.c.i -shared self.c.i:2:3: warning: array =E2=80=98builtin_names=E2=80=99 assumed to hav= e one element 2 | } builtin_names[]; | ^~~~~~~~~~~~~ /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: /tmp/ccvOAHi5.o (symbol from plugin): in function `vm_send': (.text+0x0): multiple definition of `vm_send'; /tmp/ccy7z8Z5.o (symbol from plugin):(.text+0x0): first defined here object.c.i:1:12: warning: type of =E2=80=98builtin_names=E2=80=99 does not = match original declaration [-Wlto-type-mismatch] 1 | extern int builtin_names[]; | ^ self.c.i:2:3: note: =E2=80=98builtin_names=E2=80=99 was previously declared= here 2 | } builtin_names[]; | ^ self.c.i:2:3: note: code may be misoptimized unless =E2=80=98-fno-strict-al= iasing=E2=80=99 is used object.c.i: In function =E2=80=98freeObject=E2=80=99: object.c.i:3:6: error: type mismatch in =E2=80=98array_ref=E2=80=99 3 | void freeObject() { vm_send(0, &builtin_names[6]); } | ^ int struct { } # .MEM_3 =3D VDEF <.MEM_1(D)> vm_send_g_0 =3D &builtin_names[6]; during GIMPLE pass: fixup_cfg object.c.i:3:6: internal compiler error: verify_gimple failed 0x562dba6085f4 verify_gimple_in_cfg(function*, bool, bool) =20=20=20=20=20=20=20 /usr/src/debug/sys-devel/gcc-14.0.1.9999/gcc-14.0.1.9999/gcc/tree-cfg.cc:56= 66 0x562dbbb1058c execute_function_todo =20=20=20=20=20=20=20 /usr/src/debug/sys-devel/gcc-14.0.1.9999/gcc-14.0.1.9999/gcc/passes.cc:2088 0x562dbbb1058c do_per_function =20=20=20=20=20=20=20 /usr/src/debug/sys-devel/gcc-14.0.1.9999/gcc-14.0.1.9999/gcc/passes.cc:1687 0x562dbbb1058c execute_todo =20=20=20=20=20=20=20 /usr/src/debug/sys-devel/gcc-14.0.1.9999/gcc-14.0.1.9999/gcc/passes.cc:2142 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See for instructions. lto-wrapper: fatal error: gcc returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status ```=