public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "xry111 at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/109035] meaningless memory store on RISC-V and LoongArch
Date: Wed, 08 Mar 2023 03:37:29 +0000	[thread overview]
Message-ID: <bug-109035-4-OK23DFZVJI@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109035-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---
(In reply to chenglulu from comment #2)
> I think this is most likely caused by the implementation of the public code.

Agree, so I filled the component as rtl-optimization.

I tracked a (non root) cause to the line 1944 in ira-costs.cc:

          if (i >= first_moveable_pseudo && i < last_moveable_pseudo)
            i_mem_cost = 0;
          else if (equiv_savings < 0)
            i_mem_cost = -equiv_savings;
          else if (equiv_savings > 0)
            {
              i_mem_cost = 0;    // <====== HERE
              for (k = cost_classes_ptr->num - 1; k >= 0; k--)
                i_costs[k] += equiv_savings;
            }

I don't really understand why we should prefer the memory if there is a
REG_EQUIV note, nor why this does not happen with -fPIE.

  parent reply	other threads:[~2023-03-08  3:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06  7:51 [Bug rtl-optimization/109035] New: " xry111 at gcc dot gnu.org
2023-03-06  7:52 ` [Bug rtl-optimization/109035] " xry111 at gcc dot gnu.org
2023-03-06  8:02 ` xry111 at gcc dot gnu.org
2023-03-08  3:16 ` chenglulu at loongson dot cn
2023-03-08  3:37 ` xry111 at gcc dot gnu.org [this message]
2023-03-08  3:55 ` chenglulu at loongson dot cn
2023-03-11  6:44 ` chenglulu at loongson dot cn
2023-03-11  7:00 ` chenglulu at loongson dot cn
2023-11-02 19:25 ` vmakarov at gcc dot gnu.org
2023-11-02 19:47 ` law at gcc dot gnu.org
2023-11-03  6:52 ` xry111 at gcc dot gnu.org
2023-11-03  7:46 ` xry111 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-109035-4-OK23DFZVJI@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).