Merge from trunk @ 138209
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / hot-1.c
blob608f52fd6eb9c8cd6e19b5d1edc58186b34f0c5b
1 /* Test whether using attribute((hot)) really turns on -O3. Do this test
2 by checking whether we vectorize a simple loop. */
3 /* { dg-do compile } */
4 /* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */
5 /* { dg-final { scan-assembler "addps" } } */
6 /* { dg-final { scan-assembler "subss" } } */
8 #define SIZE 1024
9 float a[SIZE] __attribute__((__aligned__(32)));
10 float b[SIZE] __attribute__((__aligned__(32)));
11 float c[SIZE] __attribute__((__aligned__(32)));
13 /* This should vectorize. */
14 void hot (void) __attribute__((__hot__));
16 void
17 hot (void)
19 int i;
21 for (i = 0; i < SIZE; i++)
22 a[i] = b[i] + c[i];
25 /* This should not vectorize. */
26 void
27 not_hot (void)
29 int i;
31 for (i = 0; i < SIZE; i++)
32 a[i] = b[i] - c[i];