aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-02-27 15:19:49 -0800
committerJim Wilson <wilson@gcc.gnu.org>1994-02-27 15:19:49 -0800
commitd391688a17b00a0a7ec88b986fd84749266a39c7 (patch)
tree848942c6dfeaa7c8229edca4155bde0fd6bc02da
parentd58b6986f4e552292ab24b8ac2f0d66b0cea083f (diff)
downloadgcc-d391688a17b00a0a7ec88b986fd84749266a39c7.zip
gcc-d391688a17b00a0a7ec88b986fd84749266a39c7.tar.gz
gcc-d391688a17b00a0a7ec88b986fd84749266a39c7.tar.bz2
(expand_call): Set nregs to -1 for BLKmode parameter,
then before move_block_to_reg call set it to the type size. From-SVN: r6660
-rw-r--r--gcc/calls.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 056ec5a..fd32beb 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1787,8 +1787,7 @@ expand_call (exp, target, ignore)
we just use a normal move insn. */
nregs = (partial ? partial
: (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode
- ? ((int_size_in_bytes (TREE_TYPE (args[i].tree_value))
- + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
+ ? -1
: 0));
/* If simple case, just do move. If normal partial, store_one_arg
@@ -1809,9 +1808,16 @@ expand_call (exp, target, ignore)
#endif
else if (args[i].partial == 0 || args[i].pass_on_stack)
- move_block_to_reg (REGNO (reg),
- validize_mem (args[i].value), nregs,
- args[i].mode);
+ {
+ /* This value might be zero, if the argument is a zero size
+ structure with no fields, so we can't use it to set nregs
+ above. */
+ nregs = ((int_size_in_bytes (TREE_TYPE (args[i].tree_value))
+ + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD);
+ move_block_to_reg (REGNO (reg),
+ validize_mem (args[i].value), nregs,
+ args[i].mode);
+ }
push_to_sequence (use_insns);
if (nregs == 0)