This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Fix ARMv3 support
- From: Christophe Lyon <christophe dot lyon at linaro dot org>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Richard Earnshaw <richard dot earnshaw at arm dot com>, Ramana Radhakrishnan <ramana dot radhakrishnan at arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 18 Feb 2016 11:22:54 +0100
- Subject: Re: RFC: Fix ARMv3 support
- Authentication-results: sourceware.org; auth=none
- References: <87lh6k8tf8 dot fsf at redhat dot com>
On 16 February 2016 at 18:19, Nick Clifton <nickc@redhat.com> wrote:
> Hi Richard, Hi Ramana,
>
> The ARM backend has some problems compiling for the old ARMv3
> architecture. See:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62254
>
> for an example of this. v3 is very old now, and I am not sure how
> much interest there is in continuing to support it, but I am trying to
> help reduce the gcc priority bug list, so here goes...
>
> The attached patch fixes the problem, albeit not in a very subtle way.
> The problem is that arm_reload_[out|in]_hi is being called for a
> register->register move because the v3 architecture does not support
> 16-bit register moves. Rather than trace the problem back to the real
> source and fix it, I chose to just allow the reload functions to
> generate an SImode register move instead. Probably not the best
> solution, but it appears to work.
>
> The attached patch also includes the test cases derived from PR 62254
> and PR 69610 (which is a duplicate of PR 62254). Including all three
> tests might be overkill, but it seemed like a good idea to be a little
> bit paranoid, just in case.
>
> Whilst testing the patch I also discovered that interworking is
> enabled by default, which is a problem for v3 code generation, so I
> added a fix to (silently) disable interworking if the target
> architecture does not support Thumb instructions.
>
> Any comments or criticisms before I apply the patch ?
Hi Nick,
Could you modify your new testcases, such that they call
check_effective_target_arm_arm_ok ?
Since you force -marm, you need to make sure that the target
cpu actually supports it.
I'm just realizing that we currently generate arm_arch_vX_ok
for X >=4 only. Maybe you should also add v3?
Thanks
Christophe.
>
> Cheers
> Nick
>
> gcc/ChangeLog
> 2016-02-16 Nick Clifton <nickc@redhat.com>
>
> PR target/62554
> PR target/69610
> * config/arm/arm.c (arm_option_override_internal): Disable
> interworking if the target does not support thumb instructions.
> (arm_reload_in_hi): Handle the case where a register to register
> move needs reloading because there is no simple pattern to handle
> it.
> (arm_reload_out_hi): Likewise.
>
> gcc/testsuite/ChangeLog
> 2016-02-16 Nick Clifton <nickc@redhat.com>
>
> PR target/62554
> PR target/69610
> * gcc.target/arm/pr62554.c: New test.
> * gcc.target/arm/pr69610-1.c: New test.
> * gcc.target/arm/pr69610-2.c: New test.
>