Index: rs6000.c =================================================================== --- rs6000.c (revision 124948) +++ rs6000.c (working copy) @@ -15050,8 +15050,17 @@ rs6000_emit_prologue (void) if (!WORLD_SAVE_P (info) && info->push_p && !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return)) { - rs6000_emit_allocate_stack (info->total_size, FALSE); + if (info->total_size < 32767) sp_offset = info->total_size; + else + frame_reg_rtx = frame_ptr_rtx; + rs6000_emit_allocate_stack (info->total_size, + (frame_reg_rtx != sp_reg_rtx + && ((info->altivec_size != 0) + || (info->vrsave_mask != 0) + ))); + if (frame_reg_rtx != sp_reg_rtx) + rs6000_emit_stack_tie (); } /* Set frame pointer, if needed. */ @@ -15392,8 +15401,7 @@ rs6000_emit_epilogue (int sibcall) } /* Set sp_offset based on the stack push from the prologue. */ - if ((DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return) - && info->total_size < 32767) + if (info->total_size < 32767) sp_offset = info->total_size; /* Restore AltiVec registers if needed. */