public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [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.
@ 2023-06-29 11:25 chenglulu at loongson dot cn
  2023-06-29 12:07 ` [Bug c++/110484] " chenglulu at loongson dot cn
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: chenglulu at loongson dot cn @ 2023-06-29 11:25 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-01  3:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29 11:25 [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 chenglulu at loongson dot cn
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

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).