This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Stormy16 reload failure in fp-cmp-5.c
- From: Geoff Keating <geoffk at geoffk dot org>
- To: Andrew Haley <aph at cambridge dot redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 31 Jan 2002 11:37:20 -0800
- Subject: Re: Stormy16 reload failure in fp-cmp-5.c
- References: <15448.20386.923422.788012@cuddles.cambridge.redhat.com>
Andrew Haley <aph@cambridge.redhat.com> writes:
> fp-cmp-5.c faile because reload is generating incorrect code.
>
> If an insn like
>
> (set (mem (post_inc (sp))) mem (post_inc (reg)))
>
> needs reloading with both the mem and reg, we end up with
>
> mov.w r6,(sp,-10)
> mov.w r7,(r6++)
> push r7
> mov.w (sp,-10),r6
>
> which is clearly wrong: reload can't cope with the sp adjustment.
>
> I fixed this by defining separate push and pop patterns that only
> accept registers. I ran the full c and c++ torture test, no
> regressions.
I don't really like this, but I couldn't think of a better way to fix
it, so the patch is approved.
> 2002-01-30 Andrew Haley <aph@cambridge.redhat.com>
>
> * config/stormy16/stormy16.md (pushqi): New.
> (popqi): New.
> (pushhi): New.
> (pophi): New.
> (movhi): Remove stack operands.
> (movqi): Likewise.
> * config/stormy16/stormy16.h (PREDICATE_CODES): Add
> nonimmediate_nonstack_operand.
> * config/stormy16/stormy16.c (nonimmediate_nonstack_operand):
> New.
> * config/stormy16/stormy16-protos.h (nonimmediate_nonstack_operand)
> New.
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>