From 11c01dcc46761825183da2f641d81aec89e38393 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sat, 15 May 2004 12:39:34 +0000 Subject: [PATCH] rs6000.c (rs6000_va_arg ): Don't use UNITS_PER_WORD to calculate gpr size. * config/rs6000/rs6000.c (rs6000_va_arg ): Don't use UNITS_PER_WORD to calculate gpr size. Re-instate code to set reg count to 8 to handle n_reg > 2. From-SVN: r81880 --- gcc/ChangeLog | 6 ++++++ gcc/config/rs6000/rs6000.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 808ed608ae9..65f431ad9a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-05-15 Alan Modra + + * config/rs6000/rs6000.c (rs6000_va_arg ): Don't use + UNITS_PER_WORD to calculate gpr size. Re-instate code to set reg + count to 8 to handle n_reg > 2. + 2004-05-15 Joseph S. Myers * doc/extend.texi: Update WG14 URL. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 9f6301b3910..4dfabe1b00b 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -5144,7 +5144,7 @@ rs6000_va_arg (tree valist, tree type) sav = build (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav); size = int_size_in_bytes (type); - rsize = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + rsize = (size + 3) / 4; align = 1; if (AGGREGATE_TYPE_P (type) @@ -5158,7 +5158,7 @@ rs6000_va_arg (tree valist, tree type) n_reg = 1; sav_ofs = 0; sav_scale = 4; - size = UNITS_PER_WORD; + size = 4; rsize = 1; } else if (TARGET_HARD_FLOAT && TARGET_FPRS @@ -5240,6 +5240,14 @@ rs6000_va_arg (tree valist, tree type) emit_barrier (); emit_label (lab_false); + if (n_reg > 2) + { + /* Ensure that we don't find any more args in regs. + Alignment has taken care of the n_reg == 2 case. */ + t = build (MODIFY_EXPR, TREE_TYPE (reg), reg, build_int_2 (8, 0)); + TREE_SIDE_EFFECTS (t) = 1; + expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); + } } /* ... otherwise out of the overflow area. */ -- 2.30.2