re PR middle-end/52750 (32xsigned char __builtin_shuffle)

PR middle-end/52750
	* 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.

From-SVN: r185914
This commit is contained in:
Jakub Jelinek 2012-03-28 16:40:57 +02:00 committed by Jakub Jelinek
parent 7d776ee252
commit 26a7fca2ed
4 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,9 @@
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 Richard Guenther <rguenther@suse.de>
* loop-init.c (loop_optimizer_init): If loops are preserved

View File

@ -1,3 +1,8 @@
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>
PR target/52692

View File

@ -0,0 +1,11 @@
/* 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);
}

View File

@ -567,8 +567,9 @@ vector_element (gimple_stmt_iterator *gsi, tree vect, tree idx, tree *ptmpvec)
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);
}
}