From 0e510d1824241953c67b38f7a894de7238c23c61 Mon Sep 17 00:00:00 2001 From: Sylvia Taylor Date: Wed, 3 Jul 2019 10:57:28 +0000 Subject: [PATCH] [aarch64]: force frame pointer setup before tlsdesc call The operation that sets up the tlsdesc register is really a function call; as such, the frame pointer should really be correctly set up before this happens. However, because it does not appear as a call_insn in the RTL the normal dependencies are not added automatically. We fix this by adding a USE of FP_REGNUM to prevent migration of the frame-pointer setup past the call by the scheduler. If a frame pointer is not being used, this is harmless since it only represents a scheduling constraint. 2019-07-03 Sylvia Taylor * config/aarch64/aarch64.md (FP_REGNUM): New constant. (tlsdesc_small_advsimd_): Add use of FP_REGNUM. (tlsdesc_small_sve_): Likewise. From-SVN: r273000 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64.md | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b255adaa16..68eb338e7fa 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-07-03 Sylvia Taylor + + * config/aarch64/aarch64.md (FP_REGNUM): New constant. + (tlsdesc_small_advsimd_): Add use of FP_REGNUM. + (tlsdesc_small_sve_): Likewise. + 2019-07-03 Martin Liska * Makefile.in: Define ZSTD_LIB. diff --git a/gcc/config/aarch64/aarch64.md b/gcc/config/aarch64/aarch64.md index 7026b3a3b92..b11bf154c9b 100644 --- a/gcc/config/aarch64/aarch64.md +++ b/gcc/config/aarch64/aarch64.md @@ -120,6 +120,7 @@ ;; Scratch registers used in frame layout. (IP0_REGNUM 16) (IP1_REGNUM 17) + (FP_REGNUM 29) (LR_REGNUM 30) ] ) @@ -6731,7 +6732,8 @@ UNSPEC_TLSDESC)) (clobber (reg:DI LR_REGNUM)) (clobber (reg:CC CC_REGNUM)) - (clobber (match_scratch:DI 1 "=r"))] + (clobber (match_scratch:DI 1 "=r")) + (use (reg:DI FP_REGNUM))] "TARGET_TLS_DESC && !TARGET_SVE" "adrp\\tx0, %A0\;ldr\\t%1, [x0, #%L0]\;add\\t0, 0, %L0\;.tlsdesccall\\t%0\;blr\\t%1" [(set_attr "type" "call") @@ -6794,7 +6796,8 @@ (clobber (reg:VNx2BI P13_REGNUM)) (clobber (reg:VNx2BI P14_REGNUM)) (clobber (reg:VNx2BI P15_REGNUM)) - (clobber (match_scratch:DI 1 "=r"))] + (clobber (match_scratch:DI 1 "=r")) + (use (reg:DI FP_REGNUM))] "TARGET_TLS_DESC && TARGET_SVE" "adrp\\tx0, %A0\;ldr\\t%1, [x0, #%L0]\;add\\t0, 0, %L0\;.tlsdesccall\\t%0\;blr\\t%1" [(set_attr "type" "call") -- 2.30.2