aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2020-05-28 09:44:32 +0200
committerRichard Biener <rguenther@suse.de>2020-05-28 09:50:35 +0200
commit07d77cc23953335c3539e2a86fc4a052d9845524 (patch)
tree21d94a81d4e48ca73b980038b4e0a7572fc0b783 /gcc
parent17d1594bfe08f3c768e024b180816cbe37ac08ac (diff)
downloadgcc-07d77cc23953335c3539e2a86fc4a052d9845524.zip
gcc-07d77cc23953335c3539e2a86fc4a052d9845524.tar.gz
gcc-07d77cc23953335c3539e2a86fc4a052d9845524.tar.bz2
testsuite/95363 - fix gcc.dg/vect/bb-slp-pr95271.c for ilp32
This fixes the testcase to avoid out of bound shifts on ilp32 targets. 2020-05-28 Richard Biener <rguenther@suse.de> PR testsuite/95363 * gcc.dg/vect/bb-slp-pr95271.c: Fix on ilp32 targets.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c
index 2f23598..f6e266c 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr95271.c
@@ -1,19 +1,22 @@
/* { dg-do compile } */
+/* { dg-require-effective-target stdint_types } */
/* { dg-additional-options "-march=cooperlake" { target x86_64-*-* i?86-*-* } } */
+#include <stdint.h>
+
int a;
struct b c;
-long d;
+int64_t d;
struct b {
- unsigned long address;
- unsigned long e;
+ uint64_t address;
+ uint64_t e;
};
void f()
{
- d = (long)(&a)[0] << 56 | (long)((unsigned char *)&a)[1] << 48 |
- (long)((unsigned char *)&a)[2] << 40 |
- (long)((unsigned char *)&a)[3] << 32 |
- (long)((unsigned char *)&a)[4] << 24 | ((unsigned char *)&a)[5] << 16 |
+ d = (int64_t)(&a)[0] << 56 | (int64_t)((unsigned char *)&a)[1] << 48 |
+ (int64_t)((unsigned char *)&a)[2] << 40 |
+ (int64_t)((unsigned char *)&a)[3] << 32 |
+ (int64_t)((unsigned char *)&a)[4] << 24 | ((unsigned char *)&a)[5] << 16 |
((unsigned char *)&a)[6] << 8 | ((unsigned char *)&a)[7];
c.address = c.e = d;
}