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
+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
--- /dev/null
+int *__attribute__((__aligned__(16))) *p;
+
+int main (void)
+{
+ return **p;
+}
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;