summaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/rs6000.c
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-07 12:23:46 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-07 12:23:46 +0000
commitce1273ae8831bc22b83d3dcdbb98cfb12bcbcb22 (patch)
treee2353cab060f79ce84740bf6daa400bdd5d0b2ba /gcc/config/rs6000/rs6000.c
parent0eb8eaa78e79abc16a7969d23db85f682f9fc6d8 (diff)
downloadgcc-ce1273ae8831bc22b83d3dcdbb98cfb12bcbcb22.tar.gz
* config/rs6000/rs6000.c (setup_incoming_varargs): Round up
va_list_gpr_size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199808 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/rs6000/rs6000.c')
-rw-r--r--gcc/config/rs6000/rs6000.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index cc16e3fb819..3e019bb0697 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -9370,20 +9370,17 @@ setup_incoming_varargs (cumulative_args_t cum, enum machine_mode mode,
if (! no_rtl && first_reg_offset < GP_ARG_NUM_REG
&& cfun->va_list_gpr_size)
{
- int nregs = GP_ARG_NUM_REG - first_reg_offset;
+ int n_gpr, nregs = GP_ARG_NUM_REG - first_reg_offset;
if (va_list_gpr_counter_field)
- {
- /* V4 va_list_gpr_size counts number of registers needed. */
- if (nregs > cfun->va_list_gpr_size)
- nregs = cfun->va_list_gpr_size;
- }
+ /* V4 va_list_gpr_size counts number of registers needed. */
+ n_gpr = cfun->va_list_gpr_size;
else
- {
- /* char * va_list instead counts number of bytes needed. */
- if (nregs > cfun->va_list_gpr_size / reg_size)
- nregs = cfun->va_list_gpr_size / reg_size;
- }
+ /* char * va_list instead counts number of bytes needed. */
+ n_gpr = (cfun->va_list_gpr_size + reg_size - 1) / reg_size;
+
+ if (nregs > n_gpr)
+ nregs = n_gpr;
mem = gen_rtx_MEM (BLKmode,
plus_constant (Pmode, save_area,