This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] ARM: exclude fixed_regs for stack-alignment save/restore
- From: Mike Stump <mikestump at comcast dot net>
- To: Roland McGrath <mcgrathr at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Jun 2012 13:13:00 -0700
- Subject: Re: [PATCH] ARM: exclude fixed_regs for stack-alignment save/restore
- References: <x57jboklg6f9.fsf@frobland.mtv.corp.google.com>
On Jun 14, 2012, at 10:16 AM, Roland McGrath wrote:
> But if e.g. I use -ffixed-r9 then I think it's a reasonable expectation
> that no code is generated that touches r9 in any way, shape, or form.
Also, I can't help but wonder if global_regs is respected. In theory, people are allowed to declare global registers, and nothing should be stopping them, though, this is abi breaking, and one does need to recompile the world as I recall to use it, so, most people don't use it and can't use it, but the bare metal people can.
Your change looks good to me.
I'll note in passing that cse.c does:
/* Determine whether register number N is considered a fixed register for the
purpose of approximating register costs.
It is desirable to replace other regs with fixed regs, to reduce need for
non-fixed hard regs.
A reg wins if it is either the frame pointer or designated as fixed. */
#define FIXED_REGNO_P(N) \
((N) == FRAME_POINTER_REGNUM || (N) == HARD_FRAME_POINTER_REGNUM \
|| fixed_regs[N] || global_regs[N])