diff options
author | Richard Biener <rguenther@suse.de> | 2012-10-19 10:32:29 +0000 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2012-10-19 10:32:29 +0000 |
commit | e9fa49f333b65a24c8d8946e8f1a677a6cc245a4 (patch) | |
tree | 662e3a1f66037369a977c4a97761a98e983b085c /gcc/tree-vect-stmts.c | |
parent | 7d3adeebe97038ec982500ced9687e4648fde382 (diff) |
2012-10-19 Richard Biener <rguenther@suse.de>
PR tree-optimization/54976
* tree-vect-stmts.c (get_vectype_for_scalar_type_and_size):
Robustify against odd inner_mode inputs.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@192611 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r-- | gcc/tree-vect-stmts.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 70bcebbe99b..09c85967d43 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -6082,16 +6082,21 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size) When the component mode passes the above test simply use a type corresponding to that mode. The theory is that any use that would cause problems with this will disable vectorization anyway. */ - if (!SCALAR_FLOAT_TYPE_P (scalar_type) - && !INTEGRAL_TYPE_P (scalar_type) - && !POINTER_TYPE_P (scalar_type)) + else if (!SCALAR_FLOAT_TYPE_P (scalar_type) + && !INTEGRAL_TYPE_P (scalar_type) + && !POINTER_TYPE_P (scalar_type)) scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1); /* We can't build a vector type of elements with alignment bigger than their size. */ - if (nbytes < TYPE_ALIGN_UNIT (scalar_type)) + else if (nbytes < TYPE_ALIGN_UNIT (scalar_type)) scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1); + /* If we felt back to using the mode fail if there was + no scalar type for it. */ + if (scalar_type == NULL_TREE) + return NULL_TREE; + /* If no size was supplied use the mode the target prefers. Otherwise lookup a vector mode of the specified size. */ if (size == 0) |