aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2012-10-12 08:00:29 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-10-12 08:00:29 +0000
commit60b95d28c0d2b2f16836ceacd5a3a9c5dd2d80f9 (patch)
treea9a9494b469a7d228389d94e0e80f352daa12fb4 /gcc/tree-vect-stmts.c
parent0b6222533e0a76c09f10d5002717bba1a7136e0b (diff)
downloadgcc-60b95d28c0d2b2f16836ceacd5a3a9c5dd2d80f9.zip
gcc-60b95d28c0d2b2f16836ceacd5a3a9c5dd2d80f9.tar.gz
gcc-60b95d28c0d2b2f16836ceacd5a3a9c5dd2d80f9.tar.bz2
re PR tree-optimization/54894 (internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1286)
2012-10-12 Richard Biener <rguenther@suse.de> PR tree-optimization/54894 * tree-vect-stmts.c (get_vectype_for_scalar_type_and_size): Handle over-aligned scalar types properly. * gcc.dg/torture/pr54894.c: New testcase. From-SVN: r192390
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 92eaac4..e1b7b7a 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -6060,11 +6060,6 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
&& GET_MODE_CLASS (inner_mode) != MODE_FLOAT)
return NULL_TREE;
- /* We can't build a vector type of elements with alignment bigger than
- their size. */
- if (nbytes < TYPE_ALIGN_UNIT (scalar_type))
- return NULL_TREE;
-
/* For vector types of elements whose mode precision doesn't
match their types precision we use a element type of mode
precision. The vectorization routines will have to make sure
@@ -6086,6 +6081,11 @@ get_vectype_for_scalar_type_and_size (tree scalar_type, unsigned size)
&& !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))
+ scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
+
/* If no size was supplied use the mode the target prefers. Otherwise
lookup a vector mode of the specified size. */
if (size == 0)