Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-bitfield-read-2-not.c

raw
1 /* { dg-require-effective-target vect_shift } */
2 /* { dg-require-effective-target vect_long_long } */
3 /* { dg-additional-options { "-fdump-tree-ifcvt-all" } } */
4
5 #include <stdarg.h>
6 #include "tree-vect.h"
7
8 extern void abort(void);
9
10 struct s {
11 char a : 4;
12 };
13
14 #define N 32
15 #define ELT0 {0}
16 #define ELT1 {1}
17 #define ELT2 {2}
18 #define ELT3 {3}
19 #define RES 48
20 struct s A[N]
21 = { ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3,
22 ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3,
23 ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3,
24 ELT0, ELT1, ELT2, ELT3, ELT0, ELT1, ELT2, ELT3};
25
26 int __attribute__ ((noipa))
27 f(struct s *ptr, unsigned n) {
28 int res = 0;
29 for (int i = 0; i < n; ++i)
30 {
31 asm volatile ("" ::: "memory");
32 res += ptr[i].a;
33 }
34 return res;
35 }
36
37 int main (void)
38 {
39 check_vect ();
40
41 if (f(&A[0], N) != RES)
42 abort ();
43
44 return 0;
45 }
46
47 /* { dg-final { scan-tree-dump-not "Bitfield OK to lower." "ifcvt" } } */
48
49