public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christophe Lyon <christophe.lyon@st.com>
To: <gcc-patches@gcc.gnu.org>
Subject: [ARM/FDPIC v6 07/24] [ARM] FDPIC: Avoid saving/restoring r9 on stack since it is read-only
Date: Mon, 09 Sep 2019 15:48:00 -0000	[thread overview]
Message-ID: <20190909154526.11630-8-christophe.lyon@st.com> (raw)
In-Reply-To: <20190909154526.11630-1-christophe.lyon@st.com>

From: Christophe Lyon <christophe.lyon@linaro.org>

2019-XX-XX  Christophe Lyon  <christophe.lyon@st.com>
	Mickaël Guêné <mickael.guene@st.com>

	gcc/
	* config/arm/arm.h (PIC_REGISTER_MAY_NEED_SAVING): New helper.
	* config/arm/arm.c (arm_compute_save_reg0_reg12_mask): Handle
	FDPIC.

Change-Id: I0f3b2023ab2a2a0433dfe081dac6bbb194b7a76c

diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index c34aab8..6ff3001 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -19571,9 +19571,7 @@ arm_compute_save_reg0_reg12_mask (void)
 	  save_reg_mask |= (1 << reg);
 
       /* Also save the pic base register if necessary.  */
-      if (flag_pic
-	  && !TARGET_SINGLE_PIC_BASE
-	  && arm_pic_register != INVALID_REGNUM
+      if (PIC_REGISTER_MAY_NEED_SAVING
 	  && crtl->uses_pic_offset_table)
 	save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
     }
@@ -19605,9 +19603,7 @@ arm_compute_save_reg0_reg12_mask (void)
 
       /* If we aren't loading the PIC register,
 	 don't stack it even though it may be live.  */
-      if (flag_pic
-	  && !TARGET_SINGLE_PIC_BASE
-	  && arm_pic_register != INVALID_REGNUM
+      if (PIC_REGISTER_MAY_NEED_SAVING
 	  && (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM)
 	      || crtl->uses_pic_offset_table))
 	save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index e404e2c..490d22d 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1960,6 +1960,13 @@ extern unsigned arm_pic_register;
 		   || label_mentioned_p (get_pool_constant (X)))))	\
 	 || tls_mentioned_p (X))
 
+/* We may want to save the PIC register if it is a dedicated one.  */
+#define PIC_REGISTER_MAY_NEED_SAVING			\
+  (flag_pic						\
+   && !TARGET_SINGLE_PIC_BASE				\
+   && !TARGET_FDPIC					\
+   && arm_pic_register != INVALID_REGNUM)
+
 /* We need to know when we are making a constant pool; this determines
    whether data needs to be in the GOT or can be referenced via a GOT
    offset.  */
-- 
2.6.3

  parent reply	other threads:[~2019-09-09 15:48 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 15:45 [ARM/FDPIC v6 00/24] FDPIC ABI for ARM Christophe Lyon
2019-09-09 15:46 ` [ARM/FDPIC v6 01/24] [ARM] FDPIC: Add -mfdpic option support Christophe Lyon
2019-09-09 15:46 ` [ARM/FDPIC v6 03/24] [ARM] FDPIC: Force FDPIC related options unless -mno-fdpic is provided Christophe Lyon
2019-09-09 15:46 ` [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts Christophe Lyon
2019-09-09 15:47 ` [ARM/FDPIC v6 04/24] [ARM] FDPIC: Add support for FDPIC for arm architecture Christophe Lyon
2019-09-09 15:47 ` [ARM/FDPIC v6 06/24] [ARM] FDPIC: Add support for c++ exceptions Christophe Lyon
2019-09-09 15:47 ` [ARM/FDPIC v6 05/24] [ARM] FDPIC: Fix __do_global_dtors_aux and frame_dummy generation Christophe Lyon
2019-09-09 15:48 ` [ARM/FDPIC v6 09/24] [ARM] FDPIC: Add support for taking address of nested function Christophe Lyon
2019-09-09 15:48 ` [ARM/FDPIC v6 08/24] [ARM] FDPIC: Enforce local/global binding for function descriptors Christophe Lyon
2019-09-09 15:48 ` Christophe Lyon [this message]
2019-09-09 15:49 ` [ARM/FDPIC v6 10/24] [ARM] FDPIC: Implement TLS support Christophe Lyon
2019-09-09 15:49 ` [ARM/FDPIC v6 12/24] [ARM] FDPIC: Restore r9 after we call __aeabi_read_tp Christophe Lyon
2019-09-09 15:49 ` [ARM/FDPIC v6 11/24] [ARM] FDPIC: Add support to unwind FDPIC signal frame Christophe Lyon
2019-09-09 15:50 ` [ARM/FDPIC v6 13/24] [ARM] FDPIC: Force LSB bit for PC in Cortex-M architecture Christophe Lyon
     [not found]   ` <7dd95d39-c60e-4f3c-fa16-2886daf44449@arm.com>
2019-09-17 11:38     ` Wilco Dijkstra
2019-09-17 12:08       ` Christophe Lyon
2019-09-19 15:13         ` Christophe Lyon
2019-09-19 15:15           ` Kyrill Tkachov
2019-09-20 12:51             ` Matthew Malcomson
2019-09-20 14:24               ` Christophe Lyon
2019-09-09 15:50 ` [ARM/FDPIC v6 14/24] [ARM][testsuite] FDPIC: Skip unsupported tests Christophe Lyon
2019-09-09 15:50 ` [ARM/FDPIC v6 15/24] [ARM][testsuite] FDPIC: Adjust scan-assembler patterns Christophe Lyon
2019-09-09 15:51 ` [ARM/FDPIC v6 18/24] [ARM][testsuite] FDPIC: Enable tests on pie_enabled targets Christophe Lyon
2019-09-09 15:51 ` [ARM/FDPIC v6 16/24] [ARM][testsuite] FDPIC: Skip tests that don't work in PIC mode Christophe Lyon
2019-09-09 15:51 ` [ARM/FDPIC v6 17/24] [ARM][testsuite] FDPIC: Handle *-*-uclinux* Christophe Lyon
2019-09-09 15:52 ` [ARM/FDPIC v6 19/24] [ARM][testsuite] FDPIC: Adjust pr43698.c to avoid clash with uclibc Christophe Lyon
2019-09-09 15:52 ` [ARM/FDPIC v6 21/24] [ARM] FDPIC: Handle stack-protector combined patterns Christophe Lyon
2019-09-09 15:52 ` [ARM/FDPIC v6 20/24] [ARM][testsuite] FDPIC: Skip tests using architectures unsupported by FDPIC Christophe Lyon
2019-09-16 12:31   ` Christophe Lyon
2019-09-17 10:18     ` Kyrill Tkachov
2019-09-09 15:53 ` [ARM/FDPIC v6 23/24] [ARM] FDPIC: Implement libitm support Christophe Lyon
2019-09-09 15:53 ` [ARM/FDPIC v6 24/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in libstdc++ configure scripts Christophe Lyon
2019-09-09 15:53 ` [ARM/FDPIC v6 22/24] [ARM][testsuite] FDPIC: Skip tests that require -static support Christophe Lyon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190909154526.11630-8-christophe.lyon@st.com \
    --to=christophe.lyon@st.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).