public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "chenglulu at loongson dot cn" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/110484] New: Spec2017 541 after adding the '-flto-fomit-frame-pointer' optimization, after optimizing the rnreg, directly replaced other registers with the $r22 register, so that the value of the $r22 register was destroyed without being saved.
Date: Thu, 29 Jun 2023 11:25:17 +0000	[thread overview]
Message-ID: <bug-110484-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 110484
           Summary: Spec2017 541 after adding the
                    '-flto-fomit-frame-pointer' optimization, after
                    optimizing the rnreg, directly replaced other
                    registers with the $r22 register, so that the value of
                    the $r22 register was destroyed without being saved.
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chenglulu at loongson dot cn
  Target Milestone: ---
            Target: loongarch64-*-linux

Spec2017 541 after adding the '-flto-fomit-frame-pointer' optimization, after
optimizing the rnreg, directly replaced other registers with the $r22 register,
so that the value of the $r22 register was destroyed without being saved.

Through debugging, it was found that when compiling the SGFTree .cpp file, the
load_from_file function generated the following template in pro_and_epilogue
optimization:
(insn 782 781 783 61 (set (mem:BLK (scratch) [0  A8])
        (unspec:BLK [
                (reg/f:DI 3 $r3)
                (reg/f:DI 22 $r22)
            ] UNSPEC_TIE)) "SGFTree.cpp":115:1 -1
     (nil))
This results in $r22 being present in the load_from_file's reg ever live list
thereafter. However, this is not desirable when the $r22 register is not used
in the function.

             reply	other threads:[~2023-06-29 11:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 11:25 chenglulu at loongson dot cn [this message]
2023-06-29 12:07 ` [Bug c++/110484] " chenglulu at loongson dot cn
2023-06-29 15:33 ` xry111 at gcc dot gnu.org
2023-09-01  2:04 ` [Bug target/110484] " cvs-commit at gcc dot gnu.org
2023-09-01  2:12 ` chenglulu at loongson dot cn
2023-09-01  2:43 ` cvs-commit at gcc dot gnu.org
2023-09-01  3:23 ` cvs-commit 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-110484-4@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).