* tree-vect-generic.c (vector_element): Perform multiplication
for pos in bitsizetype type instead of idx type.
* gcc.c-torture/compile/pr52750.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@185916
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-03-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/52750
+ * tree-vect-generic.c (vector_element): Perform multiplication
+ for pos in bitsizetype type instead of idx type.
+
2012-03-28 Georg-Johann Lay <avr@gjlay.de>
Backport from 2012-03-28 mainline r185910.
+2012-03-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR middle-end/52750
+ * gcc.c-torture/compile/pr52750.c: New test.
+
2012-03-28 Georg-Johann Lay <avr@gjlay.de>
Backport from 2012-03-28 mainline r185910.
--- /dev/null
+/* PR middle-end/52750 */
+
+typedef signed char V __attribute__((vector_size (32)));
+
+void
+foo (V *x)
+{
+ V m = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31};
+ *x = __builtin_shuffle (*x, m);
+}
/* Lower vector operations to scalar operations.
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This file is part of GCC.
else
{
tree size = TYPE_SIZE (vect_elt_type);
- tree pos = fold_build2 (MULT_EXPR, TREE_TYPE (idx), idx, size);
- return fold_build3 (BIT_FIELD_REF, vect_elt_type, vect, size, pos);
+ tree pos = fold_build2 (MULT_EXPR, bitsizetype, bitsize_int (index),
+ size);
+ return fold_build3 (BIT_FIELD_REF, vect_elt_type, vect, size, pos);
}
}