Debian Codegraph @

gcc/testsuite/gcc.dg/vect/pr57741-2.c

raw
1 /* PR tree-optimization/57741 */
2 /* { dg-require-effective-target vect_float } */
3 /* { dg-additional-options "-ffast-math" } */
4
5 #include "tree-vect.h"
6
7 extern void abort (void);
8
9 __attribute__((noinline, noclone)) void
10 foo (float *p, float *q, float x)
11 {
12 int i;
13 p = (float *) __builtin_assume_aligned (p, 32);
14 q = (float *) __builtin_assume_aligned (q, 32);
15 float f = 1.0f, g = 2.0f;
16 for (i = 0; i < 1024; i++)
17 {
18 *p++ = f;
19 f += x;
20 }
21 for (i = 0; i < 1024; i++)
22 {
23 *q++ = g;
24 g += 0.5f;
25 }
26 }
27
28 float p[1024] __attribute__((aligned (32))) = { 17.0f };
29 float q[1024] __attribute__((aligned (32))) = { 17.0f };
30
31 int
32 main ()
33 {
34 int i;
35 check_vect ();
36 foo (p, q, 1.5f);
37 #pragma GCC novector
38 for (i = 0; i < 1024; i++)
39 if (p[i] != 1.0f + i * 1.5f || q[i] != 2.0f + i * 0.5f)
40 abort ();
41 return 0;
42 }
43
44 /* { dg-final { scan-tree-dump-times "vectorized 2 loop" 1 "vect" } } */