From: Jiong Wang Date: Thu, 6 Aug 2015 16:02:16 +0000 (+0000) Subject: [AArch64] Tighten direct call pattern for sibcall to repair -fno-plt X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=201fa0b3a0a4aaf53ec0bcd154f40e2f63a8d960;p=gcc.git [AArch64] Tighten direct call pattern for sibcall to repair -fno-plt 2015-08-06 Jiong Wang gcc/ * config/aarch64/constraints.md (Usf): Add the test of aarch64_is_noplt_call_p. gcc/testsuite/ * gcc.target/aarch64/noplt_3.c: New testcase. From-SVN: r226682 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2b364ce83b9..795867a1656 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-08-06 Jiong Wang + + * config/aarch64/constraints.md (Usf): Add the test of + aarch64_is_noplt_call_p. + 2015-08-06 Jiong Wang * config/aarch64/aarch64-protos.h (aarch64_is_noplt_call_p): New declaration. diff --git a/gcc/config/aarch64/constraints.md b/gcc/config/aarch64/constraints.md index 5b189ea9d46..9dc21089154 100644 --- a/gcc/config/aarch64/constraints.md +++ b/gcc/config/aarch64/constraints.md @@ -101,8 +101,9 @@ (match_test "(unsigned HOST_WIDE_INT) ival < 64"))) (define_constraint "Usf" - "@internal Usf is a symbol reference." - (match_code "symbol_ref")) + "@internal Usf is a symbol reference under the context where plt stub allowed." + (and (match_code "symbol_ref") + (match_test "!aarch64_is_noplt_call_p (op)"))) (define_constraint "UsM" "@internal diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fb3bf07f58f..0cd004b4c1d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-08-06 Jiong Wang + + * gcc.target/aarch64/noplt_3.c: New testcase. + 2015-08-06 Jiong Wang * gcc.target/aarch64/noplt_1.c: New testcase. diff --git a/gcc/testsuite/gcc.target/aarch64/noplt_3.c b/gcc/testsuite/gcc.target/aarch64/noplt_3.c new file mode 100644 index 00000000000..c1993b670a6 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/noplt_3.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fpic -fno-plt" } */ +/* { dg-skip-if "-mcmodel=large, no support for -fpic" { aarch64-*-* } { "-mcmodel=large" } { "" } } */ + +int dec (int); + +int +cal (int a) +{ + return dec (a); +} + +void +cal_novalue (int a) +{ + dec (a); +} + +/* { dg-final { scan-assembler-times "#:got:" 2 { target { aarch64_tiny || aarch64_small } } } } */ +/* { dg-final { scan-assembler-times "#:got_lo12:" 2 { target aarch64_small } } } */