summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-28 09:45:37 +0000
committernickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-28 09:45:37 +0000
commitd37e81ec7b3bba5aff7dce108ab601e3bf0ae421 (patch)
treed365b7dbccc3e30d1477bdb69e88645f3bce536a
parentb183e51c0e7aa1b0a5141810843fb274786e983f (diff)
downloadgcc-d37e81ec7b3bba5aff7dce108ab601e3bf0ae421.tar.gz
* config/mn10300/mn10300.h (CALL_REALLY_USED_REGISTERS): Define.
* config/mn10300/mn10300.c (fp_regs_to_save): Test the call_really_used_regs array rather than the call_used_regs array. (mn10300_get_live_callee_saved_regs, expand_prologue, expand_epilogue, output_tst): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141405 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/mn10300/mn10300.c18
-rw-r--r--gcc/config/mn10300/mn10300.h7
3 files changed, 24 insertions, 9 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index dbf6e2611dd..44432df823c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-28 Nick Clifton <nickc@redhat.com>
+
+ * config/mn10300/mn10300.h (CALL_REALLY_USED_REGISTERS): Define.
+ * config/mn10300/mn10300.c (fp_regs_to_save): Test the
+ call_really_used_regs array rather than the call_used_regs array.
+ (mn10300_get_live_callee_saved_regs, expand_prologue,
+ expand_epilogue, output_tst): Likewise.
+
2008-10-27 Jakub Jelinek <jakub@redhat.com>
PR target/37378
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index eed82997244..7ee72699770 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -540,7 +540,7 @@ fp_regs_to_save (void)
return 0;
for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
- if (df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && ! call_really_used_regs[i])
++n;
return n;
@@ -617,7 +617,7 @@ mn10300_get_live_callee_saved_regs (void)
mask = 0;
for (i = 0; i <= LAST_EXTENDED_REGNUM; i++)
- if (df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && ! call_really_used_regs[i])
mask |= (1 << i);
if ((mask & 0x3c000) != 0)
mask |= 0x3c000;
@@ -804,7 +804,7 @@ expand_prologue (void)
frame pointer, size is nonzero and the user hasn't
changed the calling conventions of a0. */
if (! frame_pointer_needed && size
- && call_used_regs[FIRST_ADDRESS_REGNUM]
+ && call_really_used_regs [FIRST_ADDRESS_REGNUM]
&& ! fixed_regs[FIRST_ADDRESS_REGNUM])
{
/* Insn: add -(size + 4 * num_regs_to_save), sp. */
@@ -828,7 +828,7 @@ expand_prologue (void)
/* Consider alternative save_a0_no_merge if the user hasn't
changed the calling conventions of a0. */
- if (call_used_regs[FIRST_ADDRESS_REGNUM]
+ if (call_really_used_regs [FIRST_ADDRESS_REGNUM]
&& ! fixed_regs[FIRST_ADDRESS_REGNUM])
{
/* Insn: add -4 * num_regs_to_save, sp. */
@@ -910,7 +910,7 @@ expand_prologue (void)
/* Now actually save the FP registers. */
for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
- if (df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && ! call_really_used_regs [i])
{
rtx addr;
@@ -1046,7 +1046,7 @@ expand_epilogue (void)
/* Consider using a1 in post-increment mode, as long as the
user hasn't changed the calling conventions of a1. */
- if (call_used_regs[FIRST_ADDRESS_REGNUM+1]
+ if (call_really_used_regs [FIRST_ADDRESS_REGNUM + 1]
&& ! fixed_regs[FIRST_ADDRESS_REGNUM+1])
{
/* Insn: mov sp,a1. */
@@ -1114,7 +1114,7 @@ expand_epilogue (void)
reg = gen_rtx_POST_INC (SImode, reg);
for (i = FIRST_FP_REGNUM; i <= LAST_FP_REGNUM; ++i)
- if (df_regs_ever_live_p (i) && ! call_used_regs[i])
+ if (df_regs_ever_live_p (i) && ! call_really_used_regs [i])
{
rtx addr;
@@ -1687,7 +1687,7 @@ output_tst (rtx operand, rtx insn)
&& REGNO_REG_CLASS (REGNO (SET_DEST (set))) != EXTENDED_REGS
&& REGNO (SET_DEST (set)) != REGNO (operand)
&& (!past_call
- || !call_used_regs[REGNO (SET_DEST (set))]))
+ || ! call_really_used_regs [REGNO (SET_DEST (set))]))
{
rtx xoperands[2];
xoperands[0] = operand;
@@ -1706,7 +1706,7 @@ output_tst (rtx operand, rtx insn)
&& REGNO_REG_CLASS (REGNO (SET_DEST (set))) == EXTENDED_REGS
&& REGNO (SET_DEST (set)) != REGNO (operand)
&& (!past_call
- || !call_used_regs[REGNO (SET_DEST (set))]))
+ || ! call_really_used_regs [REGNO (SET_DEST (set))]))
{
rtx xoperands[2];
xoperands[0] = operand;
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index d83eedfb08a..62dc512bc0e 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -171,6 +171,13 @@ extern enum processor_type mn10300_processor;
, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 \
}
+/* Note: The definition of CALL_REALLY_USED_REGISTERS is not
+ redundant. It is needed when compiling in PIC mode because
+ the a2 register becomes fixed (and hence must be marked as
+ call_used) but in order to preserve the ABI it is not marked
+ as call_really_used. */
+#define CALL_REALLY_USED_REGISTERS CALL_USED_REGISTERS
+
#define REG_ALLOC_ORDER \
{ 0, 1, 4, 5, 2, 3, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 8, 9 \
, 42, 43, 44, 45, 46, 47, 48, 49, 34, 35, 36, 37, 38, 39, 40, 41 \