diff options
author | Michael Meissner <meissner@cygnus.com> | 1998-12-30 19:37:53 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 1998-12-30 19:37:53 +0000 |
commit | ff381587ecb48a6d844d87d0d22399da71716b56 (patch) | |
tree | a63c9588b5ab60b2acddeacdad0e40f8f25ddf5d | |
parent | c2a2650529c07faeb521ac3bdb1453b2938f648a (diff) | |
download | gcc-ff381587ecb48a6d844d87d0d22399da71716b56.zip gcc-ff381587ecb48a6d844d87d0d22399da71716b56.tar.gz gcc-ff381587ecb48a6d844d87d0d22399da71716b56.tar.bz2 |
Fix calculation of fpmem_offset on little endian systems; Silence warnings when building explow
From-SVN: r24443
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 76 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.md | 10 |
3 files changed, 56 insertions, 40 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8629ce7..9f27896 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 6f96bf1..2288a42 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 31e572f..b3efed9 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" "")) |