aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2002-03-13 08:56:19 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2002-03-13 08:56:19 +0100
commite387e99b29b8860d7e766d805f329b71167e1c85 (patch)
treef24c9e8242be1410ea02b25be13e9bd998a25d46 /gcc
parent09948ece3d6f36ebf908a5a2ee6b98d856bf0c92 (diff)
downloadgcc-e387e99b29b8860d7e766d805f329b71167e1c85.zip
gcc-e387e99b29b8860d7e766d805f329b71167e1c85.tar.gz
gcc-e387e99b29b8860d7e766d805f329b71167e1c85.tar.bz2
sparc.h (INITIAL_FRAME_POINTER_OFFSET): Remove.
* config/sparc/sparc.h (INITIAL_FRAME_POINTER_OFFSET): Remove. (ELIMINABLE_REGS): Add sfp->sp. (INITIAL_ELIMINATION_OFFSET): Compute sfp->sp offset too. From-SVN: r50725
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/sparc/sparc.h30
2 files changed, 25 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7127531..d78dd6c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,10 @@
-2002-03-12 Jakub Jelinek <jakub@redhat.com>
+2002-03-13 Jakub Jelinek <jakub@redhat.com>
+
+ * config/sparc/sparc.h (INITIAL_FRAME_POINTER_OFFSET): Remove.
+ (ELIMINABLE_REGS): Add sfp->sp.
+ (INITIAL_ELIMINATION_OFFSET): Compute sfp->sp offset too.
+
+2002-03-13 Jakub Jelinek <jakub@redhat.com>
PR optimization/5892
* config/ia64/ia64.c (rotate_one_bundle): Update current packet.
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index 92c8ace..8caa932 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1139,16 +1139,6 @@ extern int sparc_mode_class[];
|| !leaf_function_p ()) \
: ! (leaf_function_p () && only_leaf_regs_used ()))
-/* C statement to store the difference between the frame pointer
- and the stack pointer values immediately after the function prologue.
-
- Note, we always pretend that this is a leaf function because if
- it's not, there's no point in trying to eliminate the
- frame pointer. If it is a leaf function, we guessed right! */
-#define INITIAL_FRAME_POINTER_OFFSET(VAR) \
- ((VAR) = (TARGET_FLAT ? sparc_flat_compute_frame_size (get_frame_size ()) \
- : compute_frame_size (get_frame_size (), 1)))
-
/* Base register for access to arguments of the function. */
#define ARG_POINTER_REGNUM FRAME_POINTER_REGNUM
@@ -1577,12 +1567,28 @@ extern const char leaf_reg_remap[];
/* ??? In TARGET_FLAT mode we needn't have a hard frame pointer. */
#define ELIMINABLE_REGS \
- {{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}}
+ {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
+ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM} }
#define CAN_ELIMINATE(FROM, TO) 1
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
- ((OFFSET) = SPARC_STACK_BIAS)
+ do { \
+ (OFFSET) = 0; \
+ if ((TO) == STACK_POINTER_REGNUM) \
+ { \
+ /* Note, we always pretend that this is a leaf function \
+ because if it's not, there's no point in trying to \
+ eliminate the frame pointer. If it is a leaf \
+ function, we guessed right! */ \
+ if (TARGET_FLAT) \
+ (OFFSET) = \
+ sparc_flat_compute_frame_size (get_frame_size ()); \
+ else \
+ (OFFSET) = compute_frame_size (get_frame_size (), 1); \
+ } \
+ (OFFSET) += SPARC_STACK_BIAS; \
+ } while (0)
/* Keep the stack pointer constant throughout the function.
This is both an optimization and a necessity: longjmp