This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [COMMITTED][AArch64][sibcall]Tighten direct call pattern to repair -fno-plt
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Jiong Wang <jiong dot wang at arm dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, Alexander Monakov <amonakov at ispras dot ru>
- Date: Fri, 7 Aug 2015 09:22:42 +0100
- Subject: Re: [COMMITTED][AArch64][sibcall]Tighten direct call pattern to repair -fno-plt
- Authentication-results: sourceware.org; auth=none
- References: <55882EEB dot 7060207 at arm dot com> <alpine dot LNX dot 2 dot 11 dot 1506221927270 dot 5505 at monopod dot intra dot ispras dot ru> <CAJA7tRZ8zcTz_WjghszxVe7ZPCTA1G0xMP5oakM4iGGik=PJzg at mail dot gmail dot com> <55895E77 dot 6080305 at redhat dot com> <n99twt4h01d dot fsf at arm dot com> <alpine dot LNX dot 2 dot 20 dot 1507161335370 dot 26652 at monopod dot intra dot ispras dot ru> <n99si8ogzb2 dot fsf at arm dot com> <n997fpthe4g dot fsf at arm dot com> <20150804095033 dot GC12175 at arm dot com> <n99k2t8s84e dot fsf at arm dot com>
On Thu, Aug 06, 2015 at 05:16:33PM +0100, Jiong Wang wrote:
>
> James Greenhalgh writes:
>
> > On Tue, Jul 21, 2015 at 01:42:35PM +0100, Jiong Wang wrote:
> >>
> >> Jiong Wang writes:
> >>
> >> > Alexander Monakov writes:
> >> >
> >> >>> Attachment is the patch which repair -fno-plt support for AArch64.
> >> >>>
> >> >>> aarch64_is_noplt_call_p will only be true if:
> >> >>>
> >> >>> * gcc is generating position independent code.
> >> >>> * function symbol has declaration.
> >> >>> * either -fno-plt or "(no_plt)" attribute specified.
> >> >>> * it's a external function.
> >> >>>
> >> >>> OK for trunk?
> >> >>>
> >> >>> 2015-07-16 Jiong Wang <jiong.wang@arm.com>
> >> >>>
> >> >>> gcc/
> >> >>> * config/aarch64/aarch64-protos.h (aarch64_is_noplt_call_p): New
> >> >>> declaration.
> >> >>> * config/aarch64/aarch64.c (aarch64_is_noplt_call_p): New function.
> >> >>> * config/aarch64/aarch64.md (call_value_symbol): Check noplt
> >> >>> scenarios.
> >> >>> (call_symbol): Ditto.
> >> >>
> >> >> Shouldn't the same treatment be applied to tailcall (sibcall_{,value_}symbol)
> >> >> patterns? I guess it could be done as a followup patch, but would be nice if
> >> >> that isn't forgotten.
> >> >
> >> > Thanks for the remaind, that will be done as a followup patch.
Hi Jiong,
The new testcases introduced in this and the related patch are failing
for me on aarch64-none-elf:
aarch64-none-elf
NA->FAIL: gcc.target/aarch64/noplt_1.c scan-assembler
NA->FAIL: gcc.target/aarch64/noplt_2.c scan-assembler-times
NA->FAIL: gcc.target/aarch64/noplt_3.c scan-assembler-times
For this invocation:
.../build/obj/gcc2/gcc/xgcc -B.../build/obj/gcc2/gcc/ .../src/gcc/testsuite/gcc.target/aarch64/noplt_1.c -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -fno-plt -fpic -S -mcmodel=small -o noplt_1.s
I get this code generation for the small memory model:
foo:
stp x29, x30, [sp, -32]!
adrp x1, _GLOBAL_OFFSET_TABLE_
add x29, sp, 0
str x19, [sp, 16]
mov w19, w0
ldr x0, [x1, #:gotpage_lo15:bar]
blr x0
ldr w0, [x0, w19, sxtw 2]
ldr x19, [sp, 16]
ldp x29, x30, [sp], 32
ret
.size foo, .-foo
Which uses a different relocation.
Did you intend for these tests to be run with -fPIC -fno-plt rather than
-fpic -fno-plt, or does this indicate a bug?
Thanks,
James