From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A94253858C2C; Tue, 23 Nov 2021 15:06:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A94253858C2C From: "mittorn at sibmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/103386] New: stage1 with PGO produces bad offsets in rtl-reload on aarch64 Date: Tue, 23 Nov 2021 15:06:37 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mittorn at sibmail 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 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 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: Tue, 23 Nov 2021 15:06:37 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103386 Bug ID: 103386 Summary: stage1 with PGO produces bad offsets in rtl-reload on aarch64 Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: mittorn at sibmail dot com Target Milestone: --- Created attachment 51862 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D51862&action=3Dedit pgo build logs and system environment This result in failed conftest binary returning nonzero status when trying = to build libgomp. Simple program to reproduce conftest behaviour: int main() { return 0; } stage1 makes bad assembly on it: .cfi_startproc stp x0, x1, [sp, -32]! .cfi_def_cfa_offset 32 .cfi_offset 0, -32 .cfi_offset 1, -24 stp x2, x3, [sp, 16] .cfi_offset 2, -16 .cfi_offset 3, -8 mov w0, 0 ldp x2, x3, [sp, 16] ldp x0, x1, [sp], 32 .cfi_restore 1 .cfi_restore 0 .cfi_restore 2 .cfi_restore 3 .cfi_def_cfa_offset 0 ret .cfi_endproc instead of this one: .cfi_startproc mov w0, 0 ret .cfi_endproc after dumping RTL stages, i found this (source files are identical, second = is stage1): ~ # diff 1.c.292r.reload 2.c.292r.reload 7a8,12 > New elimination table: > Can eliminate 65 to 31 (offset=3D32, prev_offset=3D0) > Can eliminate 65 to 29 (offset=3D32, prev_offset=3D0) > Can eliminate 64 to 31 (offset=3D32, prev_offset=3D0) > Can eliminate 64 to 29 (offset=3D32, prev_offset=3D0) 51,54c56,59 < Can eliminate 65 to 31 (offset=3D0, prev_offset=3D0) < Can eliminate 65 to 29 (offset=3D0, prev_offset=3D0) < Can eliminate 64 to 31 (offset=3D0, prev_offset=3D0) < Can eliminate 64 to 29 (offset=3D0, prev_offset=3D0) --- > Can eliminate 65 to 31 (offset=3D32, prev_offset=3D32) > Can eliminate 65 to 29 (offset=3D32, prev_offset=3D0) > Can eliminate 64 to 31 (offset=3D32, prev_offset=3D32) > Can eliminate 64 to 29 (offset=3D32, prev_offset=3D0) 81c86 < (const_int 0 [0])) "1.c":3:8 52 {*movsi_aarch64} --- > (const_int 0 [0])) "2.c":3:8 52 {*movsi_aarch64} 83c88 < (insn 13 5 15 2 (use (reg/i:SI 0 x0)) "1.c":4:1 -1 --- > (insn 13 5 15 2 (use (reg/i:SI 0 x0)) "2.c":4:1 -1 Full build tree temporary placed here: http://mittorn.mentality.rip/ needed log and environment info in attachment=