public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
@ 2020-07-04 13:36 alex.popov at linux dot com
2020-07-04 16:09 ` [Bug target/96061] " hjl.tools at gmail dot com
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: alex.popov at linux dot com @ 2020-07-04 13:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
Bug ID: 96061
Summary: Please support 'no_caller_saved_registers' attribute
on aarch64 (or maybe on all targets)
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: alex.popov at linux dot com
Target Milestone: ---
This is an enhancement request.
GCC currently supports 'no_caller_saved_registers' attribute only for x86.
Clang supports it for all target architectures.
It would be very useful for Linux kernel, if GCC supported
'no_caller_saved_registers' attribute for at least aarch64. In particular, that
would allow to avoid useless work with caller-saved registers caused by
STACKLEAK GCC plugin instrumentation for the Linux kernel on aarch64.
This kernel patch uses 'no_caller_saved_registers' to fix the described issue
on x86:
https://www.openwall.com/lists/kernel-hardening/2020/06/24/13
(the patch is accepted for the mainline kernel)
That GCC enhancement can be useful for _mcount (gprof) as well.
Thanks!
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/96061] Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
@ 2020-07-04 16:09 ` hjl.tools at gmail dot com
2020-07-04 17:03 ` alex.popov at linux dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2020-07-04 16:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2020-07-04
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Alexander Popov from comment #0)
> This is an enhancement request.
>
> GCC currently supports 'no_caller_saved_registers' attribute only for x86.
> Clang supports it for all target architectures.
We are working on -fzero-call-used-regs:
https://gitlab.com/x86-gcc/gcc/-/tree/users/qinzhao/caller-saved/master
They are related.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/96061] Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
2020-07-04 16:09 ` [Bug target/96061] " hjl.tools at gmail dot com
@ 2020-07-04 17:03 ` alex.popov at linux dot com
2020-07-04 17:15 ` hjl.tools at gmail dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: alex.popov at linux dot com @ 2020-07-04 17:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
--- Comment #2 from Alexander Popov <alex.popov at linux dot com> ---
> We are working on -fzero-call-used-regs:
H.J. Lu, thanks for the information!
However, this flag can't be used per-function, like the attribute.
So supporting 'no_caller_saved_registers' attribute for aarch64 (and maybe
other architectures) is desired anyway.
Thanks!
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/96061] Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
2020-07-04 16:09 ` [Bug target/96061] " hjl.tools at gmail dot com
2020-07-04 17:03 ` alex.popov at linux dot com
@ 2020-07-04 17:15 ` hjl.tools at gmail dot com
2020-07-04 21:01 ` alex.popov at linux dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2020-07-04 17:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Alexander Popov from comment #2)
> > We are working on -fzero-call-used-regs:
>
> H.J. Lu, thanks for the information!
>
> However, this flag can't be used per-function, like the attribute.
Incorrect. There is also a zero_call_used_regs attribute.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/96061] Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
` (2 preceding siblings ...)
2020-07-04 17:15 ` hjl.tools at gmail dot com
@ 2020-07-04 21:01 ` alex.popov at linux dot com
2020-07-04 21:45 ` hjl.tools at gmail dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: alex.popov at linux dot com @ 2020-07-04 21:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
--- Comment #4 from Alexander Popov <alex.popov at linux dot com> ---
> Incorrect. There is also a zero_call_used_regs attribute.
Thanks, now I've found it in your tree:
```
You can control this behavior for a specific function by using the function
attribute @code{zero_call_used_regs}.
```
Could you explain the connection between your attribute for zeroing registers
and 'no_caller_saved_registers' attribute?
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/96061] Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
` (3 preceding siblings ...)
2020-07-04 21:01 ` alex.popov at linux dot com
@ 2020-07-04 21:45 ` hjl.tools at gmail dot com
2020-07-04 22:01 ` alex.popov at linux dot com
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2020-07-04 21:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Alexander Popov from comment #4)
> > Incorrect. There is also a zero_call_used_regs attribute.
>
> Thanks, now I've found it in your tree:
>
> ```
> You can control this behavior for a specific function by using the function
> attribute @code{zero_call_used_regs}.
> ```
>
> Could you explain the connection between your attribute for zeroing
> registers and 'no_caller_saved_registers' attribute?
We are porting
https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/caller-saved/old
from x86 back-end to middle-end. no_caller_saved_registers changes what
registers zero_call_used_regs can do. Move no_caller_saved_registers to
middle-end has a direct impact on zero_call_used_regs implementation in
middle-end.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/96061] Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
` (4 preceding siblings ...)
2020-07-04 21:45 ` hjl.tools at gmail dot com
@ 2020-07-04 22:01 ` alex.popov at linux dot com
2020-07-04 22:12 ` hjl.tools at gmail dot com
2021-12-15 11:13 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: alex.popov at linux dot com @ 2020-07-04 22:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
--- Comment #6 from Alexander Popov <alex.popov at linux dot com> ---
>> Could you explain the connection between your attribute for zeroing
>> registers and 'no_caller_saved_registers' attribute?
>
> We are porting
>
> https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/caller-saved/old
>
> from x86 back-end to middle-end. no_caller_saved_registers changes what
> registers zero_call_used_regs can do. Move no_caller_saved_registers to
> middle-end has a direct impact on zero_call_used_regs implementation in
> middle-end.
Ok. So, as I can understand, your work will enable 'no_caller_saved_registers'
attribute for all architectures. Am I right?
If so, good luck to you! Looking forward to your results.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/96061] Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
` (5 preceding siblings ...)
2020-07-04 22:01 ` alex.popov at linux dot com
@ 2020-07-04 22:12 ` hjl.tools at gmail dot com
2021-12-15 11:13 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2020-07-04 22:12 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Alexander Popov from comment #6)
> >> Could you explain the connection between your attribute for zeroing
> >> registers and 'no_caller_saved_registers' attribute?
> >
> > We are porting
> >
> > https://gitlab.com/x86-gcc/gcc/-/tree/users/hjl/caller-saved/old
> >
> > from x86 back-end to middle-end. no_caller_saved_registers changes what
> > registers zero_call_used_regs can do. Move no_caller_saved_registers to
> > middle-end has a direct impact on zero_call_used_regs implementation in
> > middle-end.
>
> Ok. So, as I can understand, your work will enable
> 'no_caller_saved_registers' attribute for all architectures. Am I right?
No. We are implementing zero_call_used_regs in middle-end. Someone
can piggyback no_caller_saved_registers on our work.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Bug target/96061] Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets)
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
` (6 preceding siblings ...)
2020-07-04 22:12 ` hjl.tools at gmail dot com
@ 2021-12-15 11:13 ` pinskia at gcc dot gnu.org
7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-15 11:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96061
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-12-15 11:13 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-04 13:36 [Bug target/96061] New: Please support 'no_caller_saved_registers' attribute on aarch64 (or maybe on all targets) alex.popov at linux dot com
2020-07-04 16:09 ` [Bug target/96061] " hjl.tools at gmail dot com
2020-07-04 17:03 ` alex.popov at linux dot com
2020-07-04 17:15 ` hjl.tools at gmail dot com
2020-07-04 21:01 ` alex.popov at linux dot com
2020-07-04 21:45 ` hjl.tools at gmail dot com
2020-07-04 22:01 ` alex.popov at linux dot com
2020-07-04 22:12 ` hjl.tools at gmail dot com
2021-12-15 11:13 ` pinskia 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).