| 1 |
/* PR middle-end/99928 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-fopenmp -fdump-tree-gimple" } */ |
| 4 |
|
| 5 |
int r00, r01, r02, r03, r04, r05; |
| 6 |
int r13, r14, r15, r16, r17, r18, r19; |
| 7 |
int r20, r21, r22, r23, r24; |
| 8 |
|
| 9 |
void |
| 10 |
foo (void) |
| 11 |
{ |
| 12 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r00\\)" "gimple" } } */ |
| 13 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r00\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 14 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r00\\)" "gimple" } } *//* FIXME. */ |
| 15 |
#pragma omp distribute parallel for reduction(+:r00) default(none) |
| 16 |
for (int i = 0; i < 64; i++) |
| 17 |
r00++; |
| 18 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r01\\)" "gimple" } } */ |
| 19 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r01\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 20 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r01\\)" "gimple" } } *//* FIXME. */ |
| 21 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r01\\)" "gimple" } } */ |
| 22 |
#pragma omp distribute parallel for simd reduction(+:r01) default(none) |
| 23 |
for (int i = 0; i < 64; i++) |
| 24 |
r01++; |
| 25 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r02\\)" "gimple" } } */ |
| 26 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r02\\)" "gimple" } } */ |
| 27 |
#pragma omp distribute simd reduction(+:r02) |
| 28 |
for (int i = 0; i < 64; i++) |
| 29 |
r02++; |
| 30 |
} |
| 31 |
|
| 32 |
void |
| 33 |
bar (void) |
| 34 |
{ |
| 35 |
int r06 = 0, r07 = 0, r08 = 0, r09 = 0; |
| 36 |
int r10 = 0, r11 = 0, r12 = 0; |
| 37 |
int r25 = 0, r26 = 0, r27 = 0, r28 = 0, r29 = 0; |
| 38 |
/* { dg-final { scan-tree-dump "omp for\[^\n\r]*reduction\\(\\+:r03\\)" "gimple" } } */ |
| 39 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r03\\)" "gimple" } } */ |
| 40 |
#pragma omp for simd reduction(+:r03) |
| 41 |
for (int i = 0; i < 64; i++) |
| 42 |
r03++; |
| 43 |
/* { dg-final { scan-tree-dump-not "omp master\[^\n\r]*reduction\\(\\+:r04\\)" "gimple" } } */ |
| 44 |
/* { dg-final { scan-tree-dump "omp taskloop\[^\n\r]*reduction\\(\\+:r04\\)" "gimple" } } */ |
| 45 |
#pragma omp master taskloop reduction(+:r04) default(none) |
| 46 |
for (int i = 0; i < 64; i++) |
| 47 |
r04++; |
| 48 |
/* { dg-final { scan-tree-dump-not "omp master\[^\n\r]*reduction\\(\\+:r05\\)" "gimple" } } */ |
| 49 |
/* { dg-final { scan-tree-dump "omp taskloop\[^\n\r]*reduction\\(\\+:r05\\)" "gimple" } } */ |
| 50 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r05\\)" "gimple" } } */ |
| 51 |
#pragma omp master taskloop simd reduction(+:r05) default(none) |
| 52 |
for (int i = 0; i < 64; i++) |
| 53 |
r05++; |
| 54 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r06\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 55 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r06\\)" "gimple" } } *//* FIXME. */ |
| 56 |
#pragma omp parallel for reduction(+:r06) default(none) |
| 57 |
for (int i = 0; i < 64; i++) |
| 58 |
r06++; |
| 59 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r07\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 60 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r07\\)" "gimple" } } *//* FIXME. */ |
| 61 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r07\\)" "gimple" } } */ |
| 62 |
#pragma omp parallel for simd reduction(+:r07) default(none) |
| 63 |
for (int i = 0; i < 64; i++) |
| 64 |
r07++; |
| 65 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*shared\\(r08\\)" "gimple" } } */ |
| 66 |
/* { dg-final { scan-tree-dump "omp for\[^\n\r]*reduction\\(\\+:r08\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 67 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r08\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 68 |
#pragma omp parallel loop reduction(+:r08) default(none) |
| 69 |
for (int i = 0; i < 64; i++) |
| 70 |
r08++; |
| 71 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r09\\)" "gimple" } } */ |
| 72 |
/* { dg-final { scan-tree-dump-not "omp master\[^\n\r]*reduction\\(\\+:r09\\)" "gimple" } } */ |
| 73 |
#pragma omp parallel master reduction(+:r09) default(none) |
| 74 |
r09++; |
| 75 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*shared\\(r10\\)" "gimple" } } */ |
| 76 |
/* { dg-final { scan-tree-dump-not "omp master\[^\n\r]*reduction\\(\\+:r10\\)" "gimple" } } */ |
| 77 |
/* { dg-final { scan-tree-dump "omp taskloop\[^\n\r]*reduction\\(\\+:r10\\)" "gimple" } } */ |
| 78 |
#pragma omp parallel master taskloop reduction(+:r10) default(none) |
| 79 |
for (int i = 0; i < 64; i++) |
| 80 |
r10++; |
| 81 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*shared\\(r11\\)" "gimple" } } */ |
| 82 |
/* { dg-final { scan-tree-dump-not "omp master\[^\n\r]*reduction\\(\\+:r11\\)" "gimple" } } */ |
| 83 |
/* { dg-final { scan-tree-dump "omp taskloop\[^\n\r]*reduction\\(\\+:r11\\)" "gimple" } } */ |
| 84 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r11\\)" "gimple" } } */ |
| 85 |
#pragma omp parallel master taskloop simd reduction(+:r11) default(none) |
| 86 |
for (int i = 0; i < 64; i++) |
| 87 |
r11++; |
| 88 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r12\\)" "gimple" } } *//* FIXME: This should be on sections instead. */ |
| 89 |
/* { dg-final { scan-tree-dump-not "omp sections\[^\n\r]*reduction\\(\\+:r12\\)" "gimple" } } *//* FIXME. */ |
| 90 |
/* { dg-final { scan-tree-dump-not "omp section \[^\n\r]*reduction\\(\\+:r12\\)" "gimple" } } */ |
| 91 |
#pragma omp parallel sections reduction(+:r12) default(none) |
| 92 |
{ |
| 93 |
r12++; |
| 94 |
#pragma omp section |
| 95 |
r12++; |
| 96 |
} |
| 97 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r13" "gimple" } } */ |
| 98 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r13\\)" "gimple" } } */ |
| 99 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r13\\)" "gimple" } } */ |
| 100 |
#pragma omp target parallel reduction(+:r13) default(none) defaultmap(none) |
| 101 |
r13++; |
| 102 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r14" "gimple" } } */ |
| 103 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r14\\)" "gimple" } } */ |
| 104 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r14\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 105 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r14\\)" "gimple" } } *//* FIXME. */ |
| 106 |
#pragma omp target parallel for reduction(+:r14) default(none) defaultmap(none) |
| 107 |
for (int i = 0; i < 64; i++) |
| 108 |
r14++; |
| 109 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r15" "gimple" } } */ |
| 110 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r15\\)" "gimple" } } */ |
| 111 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r15\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 112 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r15\\)" "gimple" } } *//* FIXME. */ |
| 113 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r15\\)" "gimple" } } */ |
| 114 |
#pragma omp target parallel for simd reduction(+:r15) default(none) defaultmap(none) |
| 115 |
for (int i = 0; i < 64; i++) |
| 116 |
r15++; |
| 117 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r16" "gimple" } } */ |
| 118 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r16\\)" "gimple" } } */ |
| 119 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*shared\\(r16\\)" "gimple" } } */ |
| 120 |
/* { dg-final { scan-tree-dump "omp for\[^\n\r]*reduction\\(\\+:r16\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 121 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r16\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 122 |
#pragma omp target parallel loop reduction(+:r16) default(none) defaultmap(none) |
| 123 |
for (int i = 0; i < 64; i++) |
| 124 |
r16++; |
| 125 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r17" "gimple" } } */ |
| 126 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r17\\)" "gimple" } } */ |
| 127 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r17\\)" "gimple" } } */ |
| 128 |
#pragma omp target teams reduction(+:r17) default(none) defaultmap(none) |
| 129 |
r17++; |
| 130 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r18" "gimple" } } */ |
| 131 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r18\\)" "gimple" } } */ |
| 132 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r18\\)" "gimple" } } */ |
| 133 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r18\\)" "gimple" } } */ |
| 134 |
#pragma omp target teams distribute reduction(+:r18) default(none) defaultmap(none) |
| 135 |
for (int i = 0; i < 64; i++) |
| 136 |
r18++; |
| 137 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r19" "gimple" } } */ |
| 138 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r19\\)" "gimple" } } */ |
| 139 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r19\\)" "gimple" } } */ |
| 140 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r19\\)" "gimple" } } */ |
| 141 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r19\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 142 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r19\\)" "gimple" } } *//* FIXME. */ |
| 143 |
#pragma omp target teams distribute parallel for reduction(+:r19) default(none) defaultmap(none) |
| 144 |
for (int i = 0; i < 64; i++) |
| 145 |
r19++; |
| 146 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r20" "gimple" } } */ |
| 147 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r20\\)" "gimple" } } */ |
| 148 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r20\\)" "gimple" } } */ |
| 149 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r20\\)" "gimple" } } */ |
| 150 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r20\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 151 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r20\\)" "gimple" } } *//* FIXME. */ |
| 152 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r20\\)" "gimple" } } */ |
| 153 |
#pragma omp target teams distribute parallel for simd reduction(+:r20) default(none) defaultmap(none) |
| 154 |
for (int i = 0; i < 64; i++) |
| 155 |
r20++; |
| 156 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r21" "gimple" } } */ |
| 157 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r21\\)" "gimple" } } */ |
| 158 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r21\\)" "gimple" } } */ |
| 159 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r21\\)" "gimple" } } */ |
| 160 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r21\\)" "gimple" } } */ |
| 161 |
#pragma omp target teams distribute simd reduction(+:r21) default(none) defaultmap(none) |
| 162 |
for (int i = 0; i < 64; i++) |
| 163 |
r21++; |
| 164 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r22" "gimple" } } */ |
| 165 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r22\\)" "gimple" } } */ |
| 166 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*shared\\(r22\\)" "gimple" } } */ |
| 167 |
/* { dg-final { scan-tree-dump "omp distribute\[^\n\r]*reduction\\(\\+:r22\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 168 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*shared\\(r22\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 169 |
/* { dg-final { scan-tree-dump "omp for\[^\n\r]*reduction\\(\\+:r22\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 170 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r22\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 171 |
#pragma omp target teams loop reduction(+:r22) default(none) defaultmap(none) |
| 172 |
for (int i = 0; i < 64; i++) |
| 173 |
r22++; |
| 174 |
/* { dg-final { scan-tree-dump "omp target\[^\n\r]*map\\(tofrom:r23" "gimple" } } */ |
| 175 |
/* { dg-final { scan-tree-dump-not "omp target\[^\n\r]*firstprivate\\(r23\\)" "gimple" } } */ |
| 176 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r23\\)" "gimple" } } */ |
| 177 |
#pragma omp target simd reduction(+:r23) defaultmap(none) |
| 178 |
for (int i = 0; i < 64; i++) |
| 179 |
r23++; |
| 180 |
/* { dg-final { scan-tree-dump "omp taskloop\[^\n\r]*reduction\\(\\+:r24\\)" "gimple" } } */ |
| 181 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r24\\)" "gimple" } } */ |
| 182 |
#pragma omp taskloop simd reduction(+:r24) default(none) |
| 183 |
for (int i = 0; i < 64; i++) |
| 184 |
r24++; |
| 185 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r25\\)" "gimple" } } */ |
| 186 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r25\\)" "gimple" } } */ |
| 187 |
#pragma omp teams distribute reduction(+:r25) default(none) |
| 188 |
for (int i = 0; i < 64; i++) |
| 189 |
r25++; |
| 190 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r26\\)" "gimple" } } */ |
| 191 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r26\\)" "gimple" } } */ |
| 192 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r26\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 193 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r26\\)" "gimple" } } *//* FIXME. */ |
| 194 |
#pragma omp teams distribute parallel for reduction(+:r26) default(none) |
| 195 |
for (int i = 0; i < 64; i++) |
| 196 |
r26++; |
| 197 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r27\\)" "gimple" } } */ |
| 198 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r27\\)" "gimple" } } */ |
| 199 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*reduction\\(\\+:r27\\)" "gimple" } } *//* FIXME: This should be on for instead. */ |
| 200 |
/* { dg-final { scan-tree-dump-not "omp for\[^\n\r]*reduction\\(\\+:r27\\)" "gimple" } } *//* FIXME. */ |
| 201 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r27\\)" "gimple" } } */ |
| 202 |
#pragma omp teams distribute parallel for simd reduction(+:r27) default(none) |
| 203 |
for (int i = 0; i < 64; i++) |
| 204 |
r27++; |
| 205 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*reduction\\(\\+:r28\\)" "gimple" } } */ |
| 206 |
/* { dg-final { scan-tree-dump-not "omp distribute\[^\n\r]*reduction\\(\\+:r28\\)" "gimple" } } */ |
| 207 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r28\\)" "gimple" } } */ |
| 208 |
#pragma omp teams distribute simd reduction(+:r28) default(none) |
| 209 |
for (int i = 0; i < 64; i++) |
| 210 |
r28++; |
| 211 |
/* { dg-final { scan-tree-dump "omp teams\[^\n\r]*shared\\(r29\\)" "gimple" } } */ |
| 212 |
/* { dg-final { scan-tree-dump "omp distribute\[^\n\r]*reduction\\(\\+:r29\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 213 |
/* { dg-final { scan-tree-dump "omp parallel\[^\n\r]*shared\\(r29\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 214 |
/* { dg-final { scan-tree-dump "omp for\[^\n\r]*reduction\\(\\+:r29\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 215 |
/* { dg-final { scan-tree-dump "omp simd\[^\n\r]*reduction\\(\\+:r29\\)" "gimple" } } *//* NOTE: This is implementation detail. */ |
| 216 |
#pragma omp teams loop reduction(+:r29) default(none) |
| 217 |
for (int i = 0; i < 64; i++) |
| 218 |
r29++; |
| 219 |
} |