(linenum→info "unix/slp.c:2238")

gcc/4.2.2/gcc/testsuite/gcc.dg/vect/pr21591.c

    1: /* { dg-do compile } */
    2: 
    3: struct a
    4: {
    5:   int length;
    6:   int a1[256];
    7: };
    8: 
    9: struct a *malloc1(__SIZE_TYPE__) __attribute__((malloc));
   10: void free(void*);
   11: 
   12: void f(void)
   13: {
   14:    struct a *a = malloc1(sizeof(struct a));
   15:    struct a *b = malloc1(sizeof(struct a));
   16:    struct a *c = malloc1(sizeof(struct a));
   17:    int i;
   18: 
   19:    for (i = 0; i < 256; i++) 
   20:    {
   21:       b->a1[i] = i;
   22:       c->a1[i] = i;
   23:    }
   24:    for (i = 0; i < 256; i++) 
   25:    {
   26:       a->a1[i] = b->a1[i] + c->a1[i];
Permalink to this note guest: gcc/4.2.2/gcc/testsuite/gcc.dg/vect/pr21591.c:26-26 on Wed Jan 16 15:22:11 +0900 2008

ポインタで表された構造体の要素に対して for文で2つの構造体の要素の和を渡している。 ITB2 by mk

27: } 28: free(a); 29: free(b); 30: free(c); 31: } 32: 33: /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ 34: /* { dg-final { cleanup-tree-dump "vect" } } */ 35:
Syntax (Markdown)