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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [ipa/] [pr50744.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
/* { dg-options "-O3 -fno-optimize-sibling-calls" } */
3
 
4
extern int use_data (void *p_01, void *p_02, void *p_03, void *p_04, void *p_05,
5
                     void *p_06, void *p_07, void *p_08, void *p_09, void *p_10,
6
                     void *p_11, void *p_12, void *p_13, void *p_14, void *p_15,
7
                     void *p_16, void *p_17, void *p_18, void *p_19, void *p_20,
8
                     void *p_21, void *p_22, void *p_23, void *p_24, void *p_25,
9
                     void *p_26, void *p_27, void *p_28, void *p_29,
10
                     void *p_30);
11
 
12
extern int idx (int i, int j, int n);
13
 
14
struct stuff
15
{
16
  int decision;
17
  int *a, *b, *c;
18
  int res;
19
};
20
 
21
 
22
#define some_large_stuff(stuff, n) { \
23
  int i, j, k; \
24
  for (i = 0; i < n; i++) \
25
    for (j = 0; j < n; j++) \
26
      { \
27
        int v = stuff->c[idx(i, j, n)]; \
28
        for (k = 0; k < n; k++) \
29
          v += stuff->a[idx(i, k, n)] * stuff->b[idx(k,j,n)]; \
30
        stuff->c[idx(i, j, n)] = v; \
31
      } \
32
}
33
 
34
#define recursion if (iter > 0) \
35
    foo (stuff, iter - 1, (void *) -1, p_01, p_02, p_03, p_04, p_05, p_06, \
36
      p_07, p_08, p_09, p_10, p_11, p_12, p_13, p_14, p_15, p_16, p_17, \
37
     p_18, p_19, p_20, p_21, p_22, p_23, p_24, p_25, p_26, p_27, p_28, p_29); \
38
    else \
39
      foo (stuff, iter, p_01, p_02, p_03, p_04, p_05, p_06, p_07, p_08, p_09, \
40
        p_10, p_11, p_12, p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20, \
41
        p_21,p_22, p_23, p_24, p_25, p_26, p_27, p_28, p_29, p_30)
42
 
43
void
44
foo (struct stuff *stuff,
45
     int iter,
46
     void *p_01, void *p_02, void *p_03, void *p_04, void *p_05,
47
     void *p_06, void *p_07, void *p_08, void *p_09, void *p_10,
48
     void *p_11, void *p_12, void *p_13, void *p_14, void *p_15,
49
     void *p_16, void *p_17, void *p_18, void *p_19, void *p_20,
50
     void *p_21, void *p_22, void *p_23, void *p_24, void *p_25,
51
     void *p_26, void *p_27, void *p_28, void *p_29, void *p_30)
52
{
53
 switch (stuff->decision)
54
   {
55
   case 0:
56
     some_large_stuff (stuff, 83);
57
     stuff->res =
58
       use_data (p_01, p_02, p_03, p_04, p_05, p_06, p_07, p_08, p_09, p_10,
59
                 p_11, p_12, p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20,
60
                 p_21, p_22, p_23, p_24, p_25, p_26, p_27, p_28, p_29, p_30);
61
     recursion;
62
     break;
63
 
64
   case 1:
65
     some_large_stuff (stuff, 25);
66
     stuff->res =
67
       use_data (p_11, p_02, p_03, p_04, p_05, p_06, p_07, p_08, p_09, p_10,
68
                 p_21, p_12, p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20,
69
                 p_01, p_22, p_23, p_24, p_25, p_26, p_27, p_28, p_29, p_30);
70
     recursion;
71
     break;
72
 
73
   case 3:
74
     some_large_stuff (stuff, 139);
75
     stuff->res =
76
       use_data (p_01, p_12, p_03, p_04, p_05, p_06, p_07, p_08, p_09, p_10,
77
                 p_11, p_22, p_13, p_14, p_15, p_16, p_17, p_18, p_19, p_20,
78
                 p_21, p_02, p_23, p_24, p_25, p_26, p_27, p_28, p_29, p_30);
79
     recursion;
80
     break;
81
 
82
   case 4:
83
     some_large_stuff (stuff, 32);
84
     stuff->res =
85
       use_data (p_01, p_02, p_13, p_04, p_05, p_06, p_07, p_08, p_09, p_10,
86
                 p_11, p_12, p_23, p_14, p_15, p_16, p_17, p_18, p_19, p_20,
87
                 p_21, p_22, p_03, p_24, p_25, p_26, p_27, p_28, p_29, p_30);
88
     recursion;
89
     break;
90
 
91
   case 5:
92
     some_large_stuff (stuff, 205);
93
     stuff->res =
94
       use_data (p_01, p_02, p_03, p_04, p_15, p_06, p_07, p_08, p_09, p_10,
95
                 p_11, p_12, p_13, p_14, p_25, p_16, p_17, p_18, p_19, p_20,
96
                 p_21, p_22, p_23, p_24, p_05, p_26, p_27, p_28, p_29, p_30);
97
     recursion;
98
     break;
99
 
100
   case 6:
101
     some_large_stuff (stuff, 64);
102
     stuff->res =
103
       use_data (p_01, p_02, p_03, p_04, p_05, p_16, p_07, p_08, p_09, p_10,
104
                 p_11, p_12, p_13, p_14, p_15, p_26, p_17, p_18, p_19, p_20,
105
                 p_21, p_22, p_23, p_24, p_25, p_06, p_27, p_28, p_29, p_30);
106
     recursion;
107
     break;
108
   }
109
}
110
 
111
#define NULL (void *)0
112
 
113
void
114
bar (struct stuff *stuff, int iter)
115
{
116
  foo (stuff, iter, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
117
       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
118
       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
119
}

powered by: WebSVN 2.1.0

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