public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/101891] New: Adjust -fzero-call-used-regs to always use XOR
@ 2021-08-12 19:47 kees at outflux dot net
  2021-08-12 20:08 ` [Bug target/101891] " pinskia at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: kees at outflux dot net @ 2021-08-12 19:47 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101891
           Summary: Adjust -fzero-call-used-regs to always use XOR
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: kees at outflux dot net
  Target Milestone: ---

Currently -fzero-call-used-regs will use a pattern of:

XOR regA,regA
MOV regA,regB
MOV regA,regC
...
RET

However, this introduces both a register ordering dependency (e.g. the CPU
cannot clear regB without clearing regA first), and while greatly reduces
available ROP gadgets, it does technically leave a set of "MOV" ROP gadgets at
the end of functions (e.g. "MOV regA,regC; RET").

Please switch to always using XOR:

XOR regA,regA
XOR regB,regB
XOR regC,regC
...
RET

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

end of thread, other threads:[~2022-05-24 18:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 19:47 [Bug middle-end/101891] New: Adjust -fzero-call-used-regs to always use XOR kees at outflux dot net
2021-08-12 20:08 ` [Bug target/101891] " pinskia at gcc dot gnu.org
2022-01-28 20:29 ` qinzhao at gcc dot gnu.org
2022-05-05 13:35 ` qinzhao at gcc dot gnu.org
2022-05-09 15:37 ` cvs-commit at gcc dot gnu.org
2022-05-09 15:43 ` qinzhao at gcc dot gnu.org
2022-05-24 15:04 ` cvs-commit at gcc dot gnu.org
2022-05-24 15:55 ` cvs-commit at gcc dot gnu.org
2022-05-24 15:55 ` qinzhao at gcc dot gnu.org
2022-05-24 16:42 ` arjan at linux dot intel.com
2022-05-24 18:47 ` qing.zhao at oracle dot com
2022-05-24 18:55 ` arjan at linux dot intel.com

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