This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][ARM] PR target/68214: Delete IP-reg-clobbering call-through-mem patterns


On Fri, Dec 4, 2015 at 9:27 AM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
> Hi all,
>
> The wrong-code in this PR occurs for pre-ARMv5 architectures with Thumb
> interworking when trying
> to use a static chain. Our output_call_mem function that outputs the
> assembly for the call explicitly
> clobbers the IP register, which is also used as the static chain register.
>
> Richard suggested offline that we can just remove the *call_mem and
> *call_value_mem patterns as they
> are of no use anymore and just cause us trouble such as this.  The midend
> does a good enough job of
> figuring out it has to load the address to which we should branch.
>
> So this patch does that. It's an entirely negative diffstat :)
> For the failing testcase gcc.dg/cwsc1.c the bad code before this patch in
> the main function is:
>     mov    ip, r4
>     ldr    r3, .L6
>     ldr    ip, [r3]
>     mov    lr, pc
>     bx    ip
>
> and with this patch it is:
>     ldr    r3, .L6
>     ldr    r3, [r3]
>     mov    ip, r4
>     mov    lr, pc
>     bx    r3
>
> As you can see it's correct and no less efficient than before.
>
> Bootstrapped and tested on arm-none-linux-gnueabihf and a test run with
> -mcpu=arm7tdmi didn't show any problems.
>
> Ok for trunk?
>

Ok - thanks.

Ramana

> Thanks,
> Kyrill
>
> 2015-12-04  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     PR target/68214
>     * config/arm/arm.md (*call_mem): Delete pattern.
>     (*call_value_mem): Likewise.
>     * config/arm/arm.c (output_call_mem): Delete.
>     * config/arm/arm-protos.h (output_call_mem): Delete prototype.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]