This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

pr64252.c: fix sizeof(int) assumption


On targets with 2 byte "int" the vectors are 16 values long, which
breaks the index count in __builtin_shuffle() using more than one
input vector.  Ok?

	* gcc.dg/pr64252.c: Fix assumption about sizeof(int).

 2015-06-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
Index: gcc.dg/pr64252.c
===================================================================
--- gcc.dg/pr64252.c	(revision 224181)
+++ gcc.dg/pr64252.c	(working copy)
@@ -1,11 +1,11 @@
 /* PR target/64252 */
 /* { dg-do run } */
 /* { dg-options "-O2" } */
 
-typedef unsigned int V __attribute__((vector_size (32)));
+typedef unsigned int V __attribute__((vector_size (sizeof(unsigned long) * 8)));
 
 __attribute__((noinline, noclone)) void
 foo (V *a, V *b, V *c, V *d, V *e)
 {
   V t = __builtin_shuffle (*a, *b, *c);
   V v = __builtin_shuffle (t, (V) { ~0U, ~0U, ~0U, ~0U, ~0U, ~0U, ~0U, ~0U }, (V) { 0, 1, 8, 3, 4, 5, 9, 7 });


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]