aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@sourceware.org>2018-06-27 05:28:06 +0000
committerSiddhesh Poyarekar <siddhesh@gcc.gnu.org>2018-06-27 05:28:06 +0000
commit643ef9571905ce704dc68ef27708e83a2a242355 (patch)
tree893e466023b775720d6b7c56c98cc714013cc9da /gcc
parent307193b82cecb8ab79cf8880d642e1a3acb9c9f6 (diff)
downloadgcc-643ef9571905ce704dc68ef27708e83a2a242355.zip
gcc-643ef9571905ce704dc68ef27708e83a2a242355.tar.gz
gcc-643ef9571905ce704dc68ef27708e83a2a242355.tar.bz2
[aarch64] Fix obsolete comment about X30
r217431 changed X30 as caller-saved in CALL_USE_REGISTERS because of which this comment about X30 not being marked as call-clobbered is no longer accurate. Fixed to describe the current state more accurately. * config/aarch64/aarch64.h (CALL_USE_REGISTERS): Fix obsolete comment. (EPILOGUE_USES): Likewise. From-SVN: r262176
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/aarch64/aarch64.h23
2 files changed, 17 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 38e4ae2..773eeaa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-27 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ * config/aarch64/aarch64.h (CALL_USE_REGISTERS): Fix obsolete
+ comment.
+ (EPILOGUE_USES): Likewise.
+
2018-06-26 Eric Botcazou <ebotcazou@adacore.com>
* tree-inline.c (remap_location): New function extracted from...
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index 976f9af..f284e74 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -303,15 +303,6 @@ extern unsigned aarch64_architecture_version;
register. GCC internally uses the poly_int variable aarch64_sve_vg
instead. */
-/* Note that we don't mark X30 as a call-clobbered register. The idea is
- that it's really the call instructions themselves which clobber X30.
- We don't care what the called function does with it afterwards.
-
- This approach makes it easier to implement sibcalls. Unlike normal
- calls, sibcalls don't clobber X30, so the register reaches the
- called function intact. EPILOGUE_USES says that X30 is useful
- to the called function. */
-
#define FIXED_REGISTERS \
{ \
0, 0, 0, 0, 0, 0, 0, 0, /* R0 - R7 */ \
@@ -327,6 +318,13 @@ extern unsigned aarch64_architecture_version;
0, 0, 0, 0, 0, 0, 0, 0, /* P8 - P15 */ \
}
+/* X30 is marked as caller-saved which is in line with regular function call
+ behavior since the call instructions clobber it; AARCH64_EXPAND_CALL does
+ that for regular function calls and avoids it for sibcalls. X30 is
+ considered live for sibcalls; EPILOGUE_USES helps achieve that by returning
+ true but not until function epilogues have been generated. This ensures
+ that X30 is available for use in leaf functions if needed. */
+
#define CALL_USED_REGISTERS \
{ \
1, 1, 1, 1, 1, 1, 1, 1, /* R0 - R7 */ \
@@ -391,9 +389,10 @@ extern unsigned aarch64_architecture_version;
V_ALIASES(28), V_ALIASES(29), V_ALIASES(30), V_ALIASES(31) \
}
-/* Say that the epilogue uses the return address register. Note that
- in the case of sibcalls, the values "used by the epilogue" are
- considered live at the start of the called function. */
+/* Say that the return address register is used by the epilogue, but only after
+ epilogue generation is complete. Note that in the case of sibcalls, the
+ values "used by the epilogue" are considered live at the start of the called
+ function. */
#define EPILOGUE_USES(REGNO) \
(epilogue_completed && (REGNO) == LR_REGNUM)