summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-26 13:34:38 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-02-26 13:34:38 +0000
commitd3791b80669d53ddc926d281fbceef21e474392f (patch)
tree34c433c5896a376908b666c2976d2a1df592a0e3 /gcc/tree-vect-stmts.c
parent4066b65158314dd0bb5b47d5c87ee06612a69383 (diff)
downloadgcc-d3791b80669d53ddc926d281fbceef21e474392f.tar.gz
2010-02-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43188 * tree-vect-stmts.c (get_vectype_for_scalar_type): Do not build vector types of over-aligned element type. * gcc.c-torture/compile/pr43188.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157088 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 99230909d7d..ce604b3dea6 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -4405,13 +4405,18 @@ tree
get_vectype_for_scalar_type (tree scalar_type)
{
enum machine_mode inner_mode = TYPE_MODE (scalar_type);
- int nbytes = GET_MODE_SIZE (inner_mode);
+ unsigned int nbytes = GET_MODE_SIZE (inner_mode);
int nunits;
tree vectype;
if (nbytes == 0 || nbytes >= UNITS_PER_SIMD_WORD (inner_mode))
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;
+
/* FORNOW: Only a single vector size per mode (UNITS_PER_SIMD_WORD)
is expected. */
nunits = UNITS_PER_SIMD_WORD (inner_mode) / nbytes;