OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [pr20122.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
short Kernshort[24] __attribute__ ((__aligned__(16)));
7
static void VecBug(short Kernel[8][24]) __attribute__((noinline));
8
static void VecBug2(short Kernel[8][24]) __attribute__((noinline));
9
 
10
/* Not vectorizable: Kernel may alias Kernshort - a global array.  */
11
static void VecBug(short Kernel[8][24])
12
{
13
  int k,i;
14
    for (k = 0; k<8; k++)
15
        for (i = 0; i<24; i++)
16
            Kernshort[i] = Kernel[k][i];
17
}
18
 
19
/* Vectorizable: Kernshort2 is local.  */
20
static void VecBug2(short Kernel[8][24])
21
{
22
  int k,i;
23
  short Kernshort2[24] __attribute__ ((__aligned__(16)));
24
    for (k = 0; k<8; k++)
25
        for (i = 0; i<24; i++)
26
            Kernshort2[i] = Kernel[k][i];
27
 
28
    for (k = 0; k<8; k++)
29
        for (i = 0; i<24; i++)
30
            if (Kernshort2[i] != Kernel[k][i])
31
                abort ();
32
}
33
 
34
int main (int argc, char **argv)
35
{
36
    check_vect ();
37
 
38
    short Kernel[8][24] __attribute__ ((__aligned__(16)));
39
    int k,i;
40
 
41
    for (k = 0; k<8; k++)
42
        for (i = 0; i<24; i++)
43
            Kernel[k][i] = 0;
44
 
45
    VecBug(Kernel);
46
    VecBug2(Kernel);
47
 
48
    return 0;
49
}
50
 
51
 
52
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_align} } } */
53
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.