From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7D5703858D3C; Fri, 22 Dec 2023 18:40:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D5703858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703270450; bh=MtIgAqA5huYcxVt1+GYG6kHhPZwc5LEhaCOWjyuW/bs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tj3C8ErBXJw2DtQgFmjplizSHByHe1aHTA7NO+aFIq4qjuG2A0Z2lyN0KAjtvot0d STT7BRG7W7cRJktoSogfyLJsD9OYdPoAxt24wnY+fsP+x0Vp1efdUQE1f6i/5oDgTg Z+JNxjYx35QOobPtLIRtuuM6axl3XE1EQYIkYH/M= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/113059] [14 regression] fftw fails tests for -O3 -m32 -march=znver2 since r14-6210-ge44ed92dbbe9d4 Date: Fri, 22 Dec 2023 18:40:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113059 --- Comment #9 from Jakub Jelinek --- Seems in *.reload we have: (insn 5 4 6 2 (set (reg/v/f:SI 4 si [orig:504 Im ] [504]) (mem/f/c:SI (plus:SI (reg/f:SI 7 sp) (const_int 540 [0x21c])) [3 Im+0 S4 A32])) "hc2cf2_16.c":45= 6:1 85 {*movsi_internal} (expr_list:REG_EQUIV (mem/f/c:SI (plus:SI (reg/f:SI 16 argp) (const_int 12 [0xc])) [3 Im+0 S4 A32]) (nil))) ... (insn 487 486 488 3 (set (mem/f/c:SI (plus:SI (reg/f:SI 7 sp) (const_int 540 [0x21c])) [3 Im+0 S4 A32]) (reg/v/f:SI 4 si [orig:504 Im ] [504])) "hc2cf2_16.c":691:14 85 {*movsi_internal} (nil)) (insn 488 487 489 3 (set (reg/v/f:SI 4 si [orig:500 W ] [500]) (reg/v/f:SI 0 ax [orig:500 W ] [500])) "hc2cf2_16.c":691:14 85 {*movsi_internal} (nil)) ... (insn 491 490 474 3 (set (reg/v/f:SI 2 cx [orig:504 Im ] [504]) (mem/f/c:SI (plus:SI (reg/f:SI 7 sp) (const_int 540 [0x21c])) [3 Im+0 S4 A32])) "hc2cf2_16.c":69= 1:14 85 {*movsi_internal} (nil)) Now, postreload removes the useless store with uid 487 and due to the swapp= ing of vzeroupper pass with postreload, the good vs. bad difference before gcse= is (insn 5 4 6 2 (set (reg/v/f:SI 4 si [orig:504 Im ] [504]) (mem/f/c:SI (plus:SI (reg/f:SI 7 sp) (const_int 540 [0x21c])) [3 Im+0 S4 A32])) "hc2cf2_16.c":4= 56:1 85 {*movsi_internal} - (expr_list:REG_EQUIV (mem/f/c:SI (plus:SI (reg/f:SI 16 argp) - (const_int 12 [0xc])) [3 Im+0 S4 A32]) - (nil))) + (expr_list:REG_UNUSED (reg/v/f:SI 4 si [orig:504 Im ] [504]) + (expr_list:REG_EQUIV (mem/f/c:SI (plus:SI (reg/f:SI 16 argp) + (const_int 12 [0xc])) [3 Im+0 S4 A32]) + (nil)))) i.e. an extra REG_UNUSED note (on some others as well). At that point the note is correct. Then comes gcse and sets cx to si at the start of the bb where insn 491 use= d to appear, extending the lifetime of the register, but the REG_UNUSED note is = not removed. And then comes the pro_and_epilogue pass and because of the REG_UNUSED note deletes the load in insn 5, even when it is now actually used. So we are back to the PR112572 discussions. Whether make REG_UNUSED notes only trusted in passes which explicitly reque= st computation of the notes problem as Richard proposed, or whether just have a couple of passes known to screw up REG_UNUSED notes to mark them as non-trustworthy (mainly cse/gcse/postreload-cse), or just when those passes actually extend lifetime of something, or attempt to remove REG_UNUSED notes actively when they extend stuff.=