Commit 2f816591 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/43188 ("error: alignment of array elements is greater than element size")

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.

From-SVN: r157088
parent 7ce321b3
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.
2010-02-26 Uros Bizjak <ubizjak@gmail.com>
PR target/43175
......
2010-02-26 Richard Guenther <rguenther@suse.de>
PR tree-optimization/43188
* gcc.c-torture/compile/pr43188.c: New testcase.
2010-02-26 H.J. Lu <hongjiu.lu@intel.com>
PR target/43175
......
int *__attribute__((__aligned__(16))) *p;
int main (void)
{
return **p;
}
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment