public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <rearnsha@arm.com>
To: Roland McGrath <mcgrathr@google.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] ARM: exclude fixed_regs for stack-alignment save/restore
Date: Tue, 24 Jul 2012 11:54:00 -0000	[thread overview]
Message-ID: <500E8CF5.5070205@arm.com> (raw)
In-Reply-To: <CAB=4xhr=LajhskDQ3YHqXeU7Ddhma7-hTJXTYVZ77xEregzoWQ@mail.gmail.com>

On 17/07/12 21:42, Roland McGrath wrote:
> Richard, here is the patch against the current trunk, as I promised
> last week in Prague.  Please apply.
> 

Done.

I've tweaked the comments slightly, but the functional modification is
unchanged.

R.

> 
> Thanks,
> Roland
> 
> 
> gcc/
> 2012-07-17  Roland McGrath  <mcgrathr@google.com>
> 
> 	* config/arm/arm.c (arm_get_frame_offsets): Never use a fixed register
> 	as the extra register to save/restore for stack-alignment padding.
> 
> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index e2f625c..189f71e 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -16121,7 +16121,12 @@ arm_get_frame_offsets (void)
>  	  else
>  	    for (i = 4; i <= (TARGET_THUMB1 ? LAST_LO_REGNUM : 11); i++)
>  	      {
> -		if ((offsets->saved_regs_mask & (1 << i)) == 0)
> +		/* While the gratuitous register save/restore is ordinarily
> +		   harmless, if a register is marked as fixed or global it
> +		   may be entirely forbidden by the system ABI to touch it,
> +		   so we should avoid those registers.  */
> +		if (!fixed_regs[i]
> +		    && (offsets->saved_regs_mask & (1 << i)) == 0)
>  		  {
>  		    reg = i;
>  		    break;
> 




  parent reply	other threads:[~2012-07-24 11:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 17:23 Roland McGrath
2012-06-14 20:22 ` Mike Stump
2012-06-14 20:51   ` Roland McGrath
2012-06-15  0:44     ` Roland McGrath
2012-06-16 14:33     ` Richard Sandiford
2012-06-18 15:39       ` Richard Earnshaw
2012-06-18 16:56         ` Roland McGrath
2012-06-20 17:37           ` Roland McGrath
2012-07-17 20:42             ` Roland McGrath
2012-07-20 20:21               ` Roland McGrath
2012-07-24 11:54               ` Richard Earnshaw [this message]
2012-07-24 16:21                 ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=500E8CF5.5070205@arm.com \
    --to=rearnsha@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mcgrathr@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).