aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNick Clifton <nickc@cambridge.redhat.com>2001-08-31 17:09:58 +0000
committerNick Clifton <nickc@gcc.gnu.org>2001-08-31 17:09:58 +0000
commitef7112de26b338a77e76e5e2b2ef0ca4ed306a37 (patch)
tree80724a69e47ab1e9e7bea1b1a982f2364ae924ff /gcc
parent7566ca495a0f9e88367203d3aa862406cc0fa8ed (diff)
downloadgcc-ef7112de26b338a77e76e5e2b2ef0ca4ed306a37.zip
gcc-ef7112de26b338a77e76e5e2b2ef0ca4ed306a37.tar.gz
gcc-ef7112de26b338a77e76e5e2b2ef0ca4ed306a37.tar.bz2
Account for FP registers saved to stack during prologue
From-SVN: r45325
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/config/arm/arm.c16
-rw-r--r--gcc/config/arm/unknown-elf.h8
3 files changed, 32 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d3406b6..34785e9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -122,6 +122,18 @@ Thu Aug 30 10:21:43 2001 J"orn Rennecke <amylaar@redhat.com>
* c-typeck.c (pointer_diff): Try to eliminate common term before
doing conversions.
+2001-08-30 Nick Clifton <nickc@cambridge.redhat.com>
+
+ * config/arm/arm.c (arm_compute_initial_elimination_offset):
+ Account for the saves of the FP registers.
+
+ * config/arm/unknown-elf.h (TEXT_SECTION): Delete.
+ (TEXT_SECTION_ASM_OP): Define.
+ (INIT_SECTION_ASM_OP): Define.
+ (FINI_SECTION_ASM_OP): Define.
+ (SUBTARGET_EXTRA_SECTIONS): Remove trailing comma.
+ (RDATA_SECTION_FUNCITON): Provide prototype.
+
2001-08-29 Geoffrey Keating <geoffk@redhat.com>
* reload1.c (move2add_note_store): Correct typo checking for
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 825a465..c3f4e2e 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -7943,16 +7943,23 @@ arm_compute_initial_elimination_offset (from, to)
{
unsigned int reg;
+ /* In theory we should check all of the hard registers to
+ see if they will be saved onto the stack. In practice
+ registers 11 upwards have special meanings and need to
+ be check individually. */
for (reg = 0; reg <= 10; reg ++)
if (regs_ever_live[reg] && ! call_used_regs[reg])
call_saved_registers += 4;
+ /* Determine if register 11 will be clobbered. */
if (! TARGET_APCS_FRAME
&& ! frame_pointer_needed
&& regs_ever_live[HARD_FRAME_POINTER_REGNUM]
&& ! call_used_regs[HARD_FRAME_POINTER_REGNUM])
call_saved_registers += 4;
+ /* The PIC register is fixed, so if the function will
+ corrupt it, it has to be saved onto the stack. */
if (flag_pic && regs_ever_live[PIC_OFFSET_TABLE_REGNUM])
call_saved_registers += 4;
@@ -7962,6 +7969,13 @@ arm_compute_initial_elimination_offset (from, to)
for it here. */
&& ! frame_pointer_needed)
call_saved_registers += 4;
+
+ /* If the hard floating point registers are going to be
+ used then they must be saved on the stack as well.
+ Each register occupies 12 bytes of stack space. */
+ for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg ++)
+ if (regs_ever_live[reg] && ! call_used_regs[reg])
+ call_saved_registers += 12;
}
/* The stack frame contains 4 registers - the old frame pointer,
@@ -7969,8 +7983,6 @@ arm_compute_initial_elimination_offset (from, to)
of the function. */
stack_frame = frame_pointer_needed ? 16 : 0;
- /* FIXME: we should allow for saved floating point registers. */
-
/* OK, now we have enough information to compute the distances.
There must be an entry in these switch tables for each pair
of registers in ELIMINABLE_REGS, even if some of the entries
diff --git a/gcc/config/arm/unknown-elf.h b/gcc/config/arm/unknown-elf.h
index fca292a..aa69278 100644
--- a/gcc/config/arm/unknown-elf.h
+++ b/gcc/config/arm/unknown-elf.h
@@ -37,7 +37,9 @@ Boston, MA 02111-1307, USA. */
#define USER_LABEL_PREFIX ""
#define LOCAL_LABEL_PREFIX "."
-#define TEXT_SECTION " .text"
+#define TEXT_SECTION_ASM_OP "\t.text"
+#define INIT_SECTION_ASM_OP "\t.section\t.init"
+#define FINI_SECTION_ASM_OP "\t.section\t.fini"
#define INVOKE__main
@@ -51,7 +53,7 @@ Boston, MA 02111-1307, USA. */
/* A list of other sections which the compiler might be "in" at any
given time. */
-#define SUBTARGET_EXTRA_SECTIONS in_rdata,
+#define SUBTARGET_EXTRA_SECTIONS in_rdata
/* A list of extra section function definitions. */
#define SUBTARGET_EXTRA_SECTION_FUNCTIONS RDATA_SECTION_FUNCTION
@@ -59,6 +61,8 @@ Boston, MA 02111-1307, USA. */
#define RDATA_SECTION_ASM_OP "\t.section .rodata"
#define RDATA_SECTION_FUNCTION \
+void rdata_section PARAMS ((void)); \
+ \
void \
rdata_section () \
{ \