aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meissner <meissner@cygnus.com>1998-12-30 19:37:53 +0000
committerMichael Meissner <meissner@cygnus.com>1998-12-30 19:37:53 +0000
commitc8bbaff7285609603732fa316bdf4b2e1171cc33 (patch)
treea63c9588b5ab60b2acddeacdad0e40f8f25ddf5d
parent851081c2c6ee0388984da6711a832758ae184066 (diff)
Fix calculation of fpmem_offset on little endian systems; Silence warnings when building explow
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@24443 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/rs6000/rs6000.c76
-rw-r--r--gcc/config/rs6000/rs6000.md10
3 files changed, 56 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8629ce799f4..9f2789645e2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+Wed Dec 30 22:24:00 1998 Michael Meissner <meissner@cygnus.com>
+
+ * rs6000.md ({save,restore}_stack_function): Take 2 operands to
+ avoid warnings in compiling explow.c.
+
+ (patch from Ken Raeburn, raeburn@cygnus.com)
+ * rs6000.c (rs6000_stack_info): Force 8-byte alignment of
+ fpmem_offset. Compute total size after that, and then
+ rs6000_fpmem_offset using both values.
+
Mon Dec 28 19:26:32 1998 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* gcc.texi (Non-bugs): ``Empty'' loops will be optimized away in
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 6f96bf1eacf..2288a42c5d5 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -3496,40 +3496,6 @@ rs6000_stack_info ()
+ info_ptr->toc_size
+ info_ptr->main_size, 8);
- total_raw_size = (info_ptr->vars_size
- + info_ptr->parm_size
- + info_ptr->fpmem_size
- + info_ptr->save_size
- + info_ptr->varargs_size
- + info_ptr->fixed_size);
-
- info_ptr->total_size = RS6000_ALIGN (total_raw_size, ABI_STACK_BOUNDARY / BITS_PER_UNIT);
-
- /* Determine if we need to allocate any stack frame:
-
- For AIX we need to push the stack if a frame pointer is needed (because
- the stack might be dynamically adjusted), if we are debugging, if we
- make calls, or if the sum of fp_save, gp_save, fpmem, and local variables
- are more than the space needed to save all non-volatile registers:
- 32-bit: 18*8 + 19*4 = 220 or 64-bit: 18*8 + 19*8 = 296
-
- For V.4 we don't have the stack cushion that AIX uses, but assume that
- the debugger can handle stackless frames. */
-
- if (info_ptr->calls_p)
- info_ptr->push_p = 1;
-
- else if (abi == ABI_V4 || abi == ABI_NT || abi == ABI_SOLARIS)
- info_ptr->push_p = (total_raw_size > info_ptr->fixed_size
- || (abi == ABI_NT ? info_ptr->lr_save_p
- : info_ptr->calls_p));
-
- else
- info_ptr->push_p = (frame_pointer_needed
- || write_symbols != NO_DEBUG
- || ((total_raw_size - info_ptr->fixed_size)
- > (TARGET_32BIT ? 220 : 296)));
-
/* Calculate the offsets */
switch (abi)
{
@@ -3569,6 +3535,44 @@ rs6000_stack_info ()
break;
}
+ if (info_ptr->fpmem_p
+ && (info_ptr->main_save_offset - info_ptr->fpmem_size) % 8)
+ info_ptr->fpmem_size += reg_size;
+
+ total_raw_size = (info_ptr->vars_size
+ + info_ptr->parm_size
+ + info_ptr->fpmem_size
+ + info_ptr->save_size
+ + info_ptr->varargs_size
+ + info_ptr->fixed_size);
+
+ info_ptr->total_size = RS6000_ALIGN (total_raw_size, ABI_STACK_BOUNDARY / BITS_PER_UNIT);
+
+ /* Determine if we need to allocate any stack frame:
+
+ For AIX we need to push the stack if a frame pointer is needed (because
+ the stack might be dynamically adjusted), if we are debugging, if we
+ make calls, or if the sum of fp_save, gp_save, fpmem, and local variables
+ are more than the space needed to save all non-volatile registers:
+ 32-bit: 18*8 + 19*4 = 220 or 64-bit: 18*8 + 19*8 = 296
+
+ For V.4 we don't have the stack cushion that AIX uses, but assume that
+ the debugger can handle stackless frames. */
+
+ if (info_ptr->calls_p)
+ info_ptr->push_p = 1;
+
+ else if (abi == ABI_V4 || abi == ABI_NT || abi == ABI_SOLARIS)
+ info_ptr->push_p = (total_raw_size > info_ptr->fixed_size
+ || (abi == ABI_NT ? info_ptr->lr_save_p
+ : info_ptr->calls_p));
+
+ else
+ info_ptr->push_p = (frame_pointer_needed
+ || write_symbols != NO_DEBUG
+ || ((total_raw_size - info_ptr->fixed_size)
+ > (TARGET_32BIT ? 220 : 296)));
+
if (info_ptr->fpmem_p)
{
info_ptr->fpmem_offset = info_ptr->main_save_offset - info_ptr->fpmem_size;
@@ -3581,10 +3585,10 @@ rs6000_stack_info ()
info_ptr->fpmem_offset = 0;
/* Zero offsets if we're not saving those registers */
- if (info_ptr->fp_size == 0)
+ if (!info_ptr->fp_size)
info_ptr->fp_save_offset = 0;
- if (info_ptr->gp_size == 0)
+ if (!info_ptr->gp_size)
info_ptr->gp_save_offset = 0;
if (!info_ptr->lr_save_p)
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 31e572fab6c..b3efed9c6a7 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -7226,14 +7226,16 @@
;; save area is a memory location.
(define_expand "save_stack_function"
- [(use (const_int 0))]
+ [(match_operand 0 "any_operand" "")
+ (match_operand 1 "any_operand" "")]
""
- "")
+ "DONE;")
(define_expand "restore_stack_function"
- [(use (const_int 0))]
+ [(match_operand 0 "any_operand" "")
+ (match_operand 1 "any_operand" "")]
""
- "")
+ "DONE;")
(define_expand "restore_stack_block"
[(use (match_operand 0 "register_operand" ""))