This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: patch to fix PR58785 (an ARM LRA crash)
- From: "Richard Earnshaw (home)" <richard dot earnshaw at buzzard dot freeserve dot co dot uk>
- To: Vladimir Makarov <vmakarov at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 30 Oct 2013 10:47:52 -0700
- Subject: Re: RFA: patch to fix PR58785 (an ARM LRA crash)
- Authentication-results: sourceware.org; auth=none
- References: <52712245 dot 1090509 at redhat dot com>
On 30 Oct 2013, at 08:16, "Vladimir Makarov" <vmakarov@redhat.com> wrote:
> The following patch fixes:
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58785
>
> LRA chooses constraint 'm' for const_int operand. It means that the
> const_int should be placed in memory but it does not happen as preferred
> reload class hook returns LO_REGS for class NO_REGS which is result of
> LRA choosing 'm'. I don't know why reload pass needs such value but it
> should be return NO_REGS IMHO as it results in much less reload insns.
>
> Is this patch ok to commit to the trunk?
>
> 2013-10-30 Vladimir Makarov <vmakarov@redhat.com>
>
> PR target/58785
> * config/arm/arm.c (arm_preferred_reload_class): Don't return
> LO_REGS for NO_REGS for LRA.
>
> 2013-10-30 Vladimir Makarov <vmakarov@redhat.com>
>
> PR target/58785
> * gcc.target/arm/pr58785.c: New.
>
> <pr58785.patch>
We've been suspicious of this hunk of code for a while now. One reading of the manual suggests that p_r_c can only return a subset of rclass, not a different class. On that basis, lo_regs as a result should only be returned when rclass is general_regs, even for traditional reload.
R.