diff options
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 530f542..1dd19c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2007-09-04 Daniel Jacobowitz <dan@codesourcery.com> + * config/rs6000/rs6000.c (rs6000_stack_info): Allocate space for the + GOT pointer only if there is a constant pool. Use the allocated space + for SPE also. + +2007-09-04 Daniel Jacobowitz <dan@codesourcery.com> + * config/rs6000/linux-unwind.h (ppc_fallback_frame_state): Correct typo for AltiVec. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 83b4ed2..9768a3f 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -13910,6 +13910,7 @@ rs6000_stack_info (void) int reg_size = TARGET_32BIT ? 4 : 8; int ehrd_size; int save_align; + int first_gp; HOST_WIDE_INT non_fixed_size; memset (&info, 0, sizeof (info)); @@ -13929,14 +13930,19 @@ rs6000_stack_info (void) /* Calculate which registers need to be saved & save area size. */ info_ptr->first_gp_reg_save = first_reg_to_save (); /* Assume that we will have to save RS6000_PIC_OFFSET_TABLE_REGNUM, - even if it currently looks like we won't. */ + even if it currently looks like we won't. Reload may need it to + get at a constant; if so, it will have already created a constant + pool entry for it. */ if (((TARGET_TOC && TARGET_MINIMAL_TOC) || (flag_pic == 1 && DEFAULT_ABI == ABI_V4) || (flag_pic && DEFAULT_ABI == ABI_DARWIN)) + && current_function_uses_const_pool && info_ptr->first_gp_reg_save > RS6000_PIC_OFFSET_TABLE_REGNUM) - info_ptr->gp_size = reg_size * (32 - RS6000_PIC_OFFSET_TABLE_REGNUM); + first_gp = RS6000_PIC_OFFSET_TABLE_REGNUM; else - info_ptr->gp_size = reg_size * (32 - info_ptr->first_gp_reg_save); + first_gp = info_ptr->first_gp_reg_save; + + info_ptr->gp_size = reg_size * (32 - first_gp); /* For the SPE, we have an additional upper 32-bits on each GPR. Ideally we should save the entire 64-bits only when the upper @@ -14024,7 +14030,7 @@ rs6000_stack_info (void) + info_ptr->parm_size); if (TARGET_SPE_ABI && info_ptr->spe_64bit_regs_used != 0) - info_ptr->spe_gp_size = 8 * (32 - info_ptr->first_gp_reg_save); + info_ptr->spe_gp_size = 8 * (32 - first_gp); else info_ptr->spe_gp_size = 0; |