]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.target/i386/hot-1.c
PR c++/37288
[thirdparty/gcc.git] / gcc / testsuite / gcc.target / i386 / hot-1.c
CommitLineData
46f8e3b0 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" } } */
7
8#define SIZE 1024
9float a[SIZE] __attribute__((__aligned__(32)));
10float b[SIZE] __attribute__((__aligned__(32)));
11float c[SIZE] __attribute__((__aligned__(32)));
12
13/* This should vectorize. */
14void hot (void) __attribute__((__hot__));
15
16void
17hot (void)
18{
19 int i;
20
21 for (i = 0; i < SIZE; i++)
22 a[i] = b[i] + c[i];
23}
24
25/* This should not vectorize. */
26void
27not_hot (void)
28{
29 int i;
30
31 for (i = 0; i < SIZE; i++)
32 a[i] = b[i] - c[i];
33}