https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117870
Bug ID: 117870
Summary: Suggestion - make the flags -ffixed, -fcall-used and
-fcall-saved per function
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: mikulas at artax dot karlin.mff.cuni.cz
Target Milestone: ---
Hi
This is just a suggestion for enhancement - would it be possible to support the
flags -ffixed, -fcall-used and -fcall-saved per function rather than per-file?
Currently, these flags may only be set for the whole file - it makes them not
much useful, because if the functions in the file need to interoperate with
libraries or other parts of the program, the file needs to have the standard
ABI.
If would be good if we could write something like
"__attribute__((optimize("-fcall-saved-r10"))) int f(int a) { return a + 1; }".
Note that with Intel APX we get 16 new registers, unfortunately, all of them
are volatile according to the ABI - it would be benefical if we could make some
of them saved in performance-critical parts of the program.
Mikulas