aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-04-30 07:22:58 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-04-30 07:22:58 -0400
commit67225c151ef76370f5bd0732ba2287a74e0c85a5 (patch)
treef1b4183796af77e902dd5db15168e2a525cb04b9
parentc256df0bf7bd0b72dc8df19c49972051f0bfa5cf (diff)
downloadgcc-67225c151ef76370f5bd0732ba2287a74e0c85a5.zip
gcc-67225c151ef76370f5bd0732ba2287a74e0c85a5.tar.gz
gcc-67225c151ef76370f5bd0732ba2287a74e0c85a5.tar.bz2
(expand_expr, case CONSTRUCTOR): Don't set target to zero if more then one word.
(expand_expr, case CONSTRUCTOR): Don't set target to zero if more then one word. Pass size and alignment to move_by_pieces_ninsns in bytes, not bits. From-SVN: r9548
-rw-r--r--gcc/expr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 8186189..e940ccb 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -2984,8 +2984,10 @@ store_constructor (exp, target)
/* If we are building a static constructor into a register,
set the initial value as zero so we can fold the value into
- a constant. */
- else if (GET_CODE (target) == REG && TREE_STATIC (exp))
+ a constant. But if more than one register is involved,
+ this probably loses. */
+ else if (GET_CODE (target) == REG && TREE_STATIC (exp)
+ && GET_MODE_SIZE (GET_MODE (target)) <= UNITS_PER_WORD)
emit_move_insn (target, const0_rtx);
/* If the constructor has fewer fields than the structure,
@@ -4473,8 +4475,8 @@ expand_expr (exp, target, tmode, modifier)
|| TREE_ADDRESSABLE (exp)
|| (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
&& (move_by_pieces_ninsns
- (TREE_INT_CST_LOW (TYPE_SIZE (type)),
- TYPE_ALIGN (type))
+ (TREE_INT_CST_LOW (TYPE_SIZE (type))/BITS_PER_UNIT,
+ TYPE_ALIGN (type) / BITS_PER_UNIT)
> MOVE_RATIO))))
|| (modifier == EXPAND_INITIALIZER && TREE_CONSTANT (exp)))
{