diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-06 09:41:09 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-06 09:41:09 +0000 |
commit | a5b5b624bd32ed2a8cdef6c91105a0c58ead9e0a (patch) | |
tree | a8ba90785cb82182fb5dd973f850d3ab8a6f2973 /gcc/config/sparc | |
parent | 825825ba216d22b9b0cc6b4df4cc80e25a4df432 (diff) | |
download | gcc-a5b5b624bd32ed2a8cdef6c91105a0c58ead9e0a.tar.gz |
2012-06-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 188257 using svnmerge
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@188260 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sparc')
-rw-r--r-- | gcc/config/sparc/sparc-protos.h | 1 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.c | 17 | ||||
-rw-r--r-- | gcc/config/sparc/sparc.h | 15 |
3 files changed, 24 insertions, 9 deletions
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h index 52acc096ce3..b03f5cc5858 100644 --- a/gcc/config/sparc/sparc-protos.h +++ b/gcc/config/sparc/sparc-protos.h @@ -37,6 +37,7 @@ extern enum direction function_arg_padding (enum machine_mode, const_tree); extern void order_regs_for_local_alloc (void); extern HOST_WIDE_INT sparc_compute_frame_size (HOST_WIDE_INT, int); +extern int sparc_initial_elimination_offset (int); extern void sparc_expand_prologue (void); extern void sparc_flat_expand_prologue (void); extern void sparc_expand_epilogue (bool); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 54fce8f6ddb..7b1899d661c 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -4551,6 +4551,23 @@ sparc_compute_frame_size (HOST_WIDE_INT size, int leaf_function) return frame_size; } +/* Implement the macro INITIAL_ELIMINATION_OFFSET, return the OFFSET. */ + +int +sparc_initial_elimination_offset (int to) +{ + int offset; + + if (to == STACK_POINTER_REGNUM) + offset = sparc_compute_frame_size (get_frame_size (), + current_function_is_leaf); + else + offset = 0; + + offset += SPARC_STACK_BIAS; + return offset; +} + /* Output any necessary .register pseudo-ops. */ void diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index a2bf09f1c81..234edcfd9c4 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1104,15 +1104,12 @@ extern char leaf_reg_remap[]; {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM} } -#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ - do { \ - if ((TO) == STACK_POINTER_REGNUM) \ - (OFFSET) = sparc_compute_frame_size (get_frame_size (), \ - current_function_is_leaf); \ - else \ - (OFFSET) = 0; \ - (OFFSET) += SPARC_STACK_BIAS; \ - } while (0) +#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ + do \ + { \ + (OFFSET) = sparc_initial_elimination_offset ((TO)); \ + } \ + while (0) /* Keep the stack pointer constant throughout the function. This is both an optimization and a necessity: longjmp |