public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.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	[thread overview]
Message-ID: <bug-113059-4-gji4D1NA8J@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113059-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113059

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
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":456: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":691:14
85 {*movsi_internal}
     (nil))
Now, postreload removes the useless store with uid 487 and due to the swapping
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":456: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 used 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 request
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.

  parent reply	other threads:[~2023-12-22 18:40 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18  9:12 [Bug target/113059] New: " sjames at gcc dot gnu.org
2023-12-18  9:30 ` [Bug target/113059] " rguenth at gcc dot gnu.org
2023-12-22  9:47 ` jakub at gcc dot gnu.org
2023-12-22 13:55 ` sjames at gcc dot gnu.org
2023-12-22 16:51 ` jakub at gcc dot gnu.org
2023-12-22 17:57 ` jakub at gcc dot gnu.org
2023-12-22 18:11 ` jakub at gcc dot gnu.org
2023-12-22 18:11 ` jakub at gcc dot gnu.org
2023-12-22 18:14 ` jakub at gcc dot gnu.org
2023-12-22 18:30 ` fw at gcc dot gnu.org
2023-12-22 18:40 ` jakub at gcc dot gnu.org [this message]
2023-12-22 18:41 ` jakub at gcc dot gnu.org
2024-01-09 16:03 ` jakub at gcc dot gnu.org
2024-01-10  9:10 ` rguenth at gcc dot gnu.org
2024-01-10  9:19 ` jakub at gcc dot gnu.org
2024-01-10  9:53 ` rguenther at suse dot de
2024-01-10 18:24 ` pinskia at gcc dot gnu.org
2024-01-30  7:59 ` sjames at gcc dot gnu.org
2024-01-30  9:23 ` jakub at gcc dot gnu.org
2024-01-30 10:25 ` rguenth at gcc dot gnu.org
2024-01-30 10:32 ` jakub at gcc dot gnu.org
2024-01-30 10:45 ` jakub at gcc dot gnu.org
2024-01-30 10:46 ` rguenther at suse dot de
2024-01-30 10:47 ` rguenth at gcc dot gnu.org
2024-01-30 11:17 ` jakub at gcc dot gnu.org
2024-01-30 11:39 ` jakub at gcc dot gnu.org
2024-02-05  8:36 ` cvs-commit at gcc dot gnu.org
2024-02-05  8:38 ` [Bug target/113059] [15 " jakub at gcc dot gnu.org
2024-02-23 15:49 ` sjames at gcc dot gnu.org
2024-02-23 15:49 ` sjames at gcc dot gnu.org
2024-03-06 16:44 ` sjames at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-113059-4-gji4D1NA8J@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).