diff options
author | Alan Modra <amodra@gmail.com> | 2013-06-07 21:53:46 +0930 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2013-06-07 21:53:46 +0930 |
commit | 8f90b7d4fcde936b2458835eebf84cba5b23e1e2 (patch) | |
tree | e2353cab060f79ce84740bf6daa400bdd5d0b2ba /gcc/config/rs6000 | |
parent | 961ce1191f290dc2abdd987427a6972622ed85a8 (diff) | |
download | gcc-8f90b7d4fcde936b2458835eebf84cba5b23e1e2.zip gcc-8f90b7d4fcde936b2458835eebf84cba5b23e1e2.tar.gz gcc-8f90b7d4fcde936b2458835eebf84cba5b23e1e2.tar.bz2 |
rs6000.c (setup_incoming_varargs): Round up va_list_gpr_size.
* config/rs6000/rs6000.c (setup_incoming_varargs): Round up
va_list_gpr_size.
From-SVN: r199808
Diffstat (limited to 'gcc/config/rs6000')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index cc16e3f..3e019bb 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, |