public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103503] New: RFE: no save registers attribute
@ 2021-11-30 18:06 hpa at zytor dot com
  2021-11-30 21:00 ` [Bug target/103503] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hpa at zytor dot com @ 2021-11-30 18:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103503
           Summary: RFE: no save registers attribute
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hpa at zytor dot com
  Target Milestone: ---
            Target: multiple

When a common assembly interrupt entry code or an equivalent hardware engine is
used to handle register saves in an interrupt routine, it may be completely
unnecessary to save and restore registers in the interrupt handler itself, even
if they would normally be clobbered.

Unfortunately [-f]call-used-reg is not supported by either
__attribute__((optimize)) nor _Pragma("GCC optimize"); otherwise that would be
a very valid solution.

Putting all interrupt handlers in a separate compilation unit is awkward at the
very best.

AVR has __attribute__((OS_{task,main})) for this purpose, but being able to do
it in general would improve interrupt/trap latency.

See also bug 38534.

Note: not saving the registers in the assembly wrapper is generally not an
option; similarly, whether or not a hardware engine can do it practically
depends on both the hardware implementation and the ABI. The RISC-V ABI, for
example, scatters clobbered and saved registers all over the register map,
which makes doing such a thing in hardware difficult.

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

end of thread, other threads:[~2024-05-15 16:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 18:06 [Bug target/103503] New: RFE: no save registers attribute hpa at zytor dot com
2021-11-30 21:00 ` [Bug target/103503] " pinskia at gcc dot gnu.org
2021-11-30 21:02 ` pinskia at gcc dot gnu.org
2021-11-30 21:03 ` pinskia at gcc dot gnu.org
2021-11-30 21:03 ` pinskia at gcc dot gnu.org
2022-06-06 17:00 ` hpa at zytor dot com
2024-01-11  3:44 ` hjl.tools at gmail dot com
2024-01-27 12:19 ` cvs-commit at gcc dot gnu.org
2024-05-15 16:17 ` hpa at zytor dot 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).