This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [sh] fix sp_switch attribute
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: dj at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 31 Jul 2009 13:54:06 +0900 (JST)
- Subject: Re: [sh] fix sp_switch attribute
- References: <200907310215.n6V2Fes4012017@greed.delorie.com>
DJ Delorie <dj@redhat.com> wrote:
> This patch switches to using an unspec_volatile to keep things around,
> and uses the constant pool to save the address of the new stack
> pointer.
>
> Ok to apply?
>
> * config/sh/sh.md (UNSPECV_SP_SWITCH_B): New.
> (UNSPECV_SP_SWITCH_E): New.
> (sp_switch_1): Change to an unspec.
> (sp_switch_2): Change to an unspec. Don't use post-inc when we
> replace $r15.
> * config/sh/sh.c (sh_expand_prologue): Use the constant pool to
> reference the new stack's address
Thanks for looking into this issue.
> + = ggc_strdup (TREE_STRING_POINTER (TREE_VALUE ( TREE_VALUE (sp_switch_attr))));
Could you please replace this with
tree arg = TREE_VALUE (TREE_VALUE (sp_switch_attr));
const char *s = ggc_strdup (TREE_STRING_POINTER (arg));
or some such lines to avoid 80 column overflow?
I assume that the patch is tested on an appropriate sh target.
OK with the above change.
Regards,
kaz