From a43fa0ddb94ba36fae8c8c29b2113d7db26b509a Mon Sep 17 00:00:00 2001 From: aldyh Date: Fri, 31 May 2002 02:21:31 +0000 Subject: [PATCH] 2002-05-31 Aldy Hernandez * expr.c (expand_expr): Output partially zeroed out vectors with output_constant_def. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54080 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/expr.c | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0a59a30..3e6bc49 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-05-31 Aldy Hernandez + + * expr.c (expand_expr): Output partially zeroed out vectors with + output_constant_def. + 2002-05-30 Jason Thorpe * config.gcc (sh[123456789l]*-*-*): Set cpu_type to sh. diff --git a/gcc/expr.c b/gcc/expr.c index f839b40..b373ad2 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -6758,7 +6758,13 @@ expand_expr (exp, target, tmode, modifier) fold. Likewise, if we have a target we can use, it is best to store directly into the target unless the type is large enough that memcpy will be used. If we are making an initializer and - all operands are constant, put it in memory as well. */ + all operands are constant, put it in memory as well. + + FIXME: Avoid trying to fill vector constructors piece-meal. + Output them with output_constant_def below unless we're sure + they're zeros. This should go away when vector initializers + are treated like VECTOR_CST instead of arrays. + */ else if ((TREE_STATIC (exp) && ((mode == BLKmode && ! (target != 0 && safe_from_p (target, exp, 1))) @@ -6767,7 +6773,9 @@ expand_expr (exp, target, tmode, modifier) && (! MOVE_BY_PIECES_P (tree_low_cst (TYPE_SIZE_UNIT (type), 1), TYPE_ALIGN (type))) - && ! mostly_zeros_p (exp)))) + && ((TREE_CODE (type) == VECTOR_TYPE + && !is_zeros_p (exp)) + || ! mostly_zeros_p (exp))))) || (modifier == EXPAND_INITIALIZER && TREE_CONSTANT (exp))) { rtx constructor = output_constant_def (exp, 1); -- 2.7.4