summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-generic.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-26 20:55:39 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-26 20:55:39 +0000
commit93a5c11856edd42ccba7294c44cb80c723de80fd (patch)
treed99a9242d8cf95d13f1607da9d029fec2d1ad48f /gcc/tree-vect-generic.c
parente561a4d3628eedc50e20ce55a790a1677d202c04 (diff)
downloadgcc-93a5c11856edd42ccba7294c44cb80c723de80fd.tar.gz
PR middle-end/59273
* tree-vect-generic.c (optimize_vector_constructor): Don't optimize if there isn't optab handler for the corresponding vector PLUS_EXPR. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205414 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-generic.c')
-rw-r--r--gcc/tree-vect-generic.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 87130bd5a9f..d55485dbeaa 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -1015,9 +1015,14 @@ optimize_vector_constructor (gimple_stmt_iterator *gsi)
tree *cst;
gimple g;
tree base = NULL_TREE;
+ optab op;
if (nelts <= 2 || CONSTRUCTOR_NELTS (rhs) != nelts)
return;
+ op = optab_for_tree_code (PLUS_EXPR, type, optab_default);
+ if (op == unknown_optab
+ || optab_handler (op, TYPE_MODE (type)) == CODE_FOR_nothing)
+ return;
FOR_EACH_VEC_SAFE_ELT (CONSTRUCTOR_ELTS (rhs), i, elt)
if (TREE_CODE (elt->value) != SSA_NAME
|| TREE_CODE (TREE_TYPE (elt->value)) == VECTOR_TYPE)