This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
pr64252.c: fix sizeof(int) assumption
- From: DJ Delorie <dj at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 6 Jun 2015 01:12:06 -0400
- Subject: pr64252.c: fix sizeof(int) assumption
- Authentication-results: sourceware.org; auth=none
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 });