1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fcompare-debug -w" } */
4 typedef union tree_node
*tree
;
5 typedef unsigned int source_location
;
11 struct tree_omp_clause
13 union omp_clause_subcode
15 enum tree_code reduction_code
;
20 struct tree_omp_clause omp_clause
;
28 unsigned allocatable
:1;
30 unsigned codimension
:1;
34 unsigned contiguous
:1;
35 unsigned referenced
:1;
37 typedef unsigned int gfc_char_t
;
38 typedef struct gfc_linebuf
40 source_location location
;
49 struct gfc_symbol
*sym
;
50 struct gfc_namelist
*next
;
55 OMP_LIST_REDUCTION_FIRST
= OMP_LIST_PLUS
,
60 typedef struct gfc_omp_clauses
62 gfc_namelist
*lists
[OMP_LIST_NUM
];
64 typedef struct gfc_symbol
66 symbol_attribute attr
;
68 typedef struct gfc_code
73 gfc_omp_clauses
*omp_clauses
;
81 gfc_trans_omp_reduction_list (gfc_namelist
* namelist
, tree list
,
82 enum tree_code reduction_code
, locus where
)
84 for (; namelist
!= ((void *) 0); namelist
= namelist
->next
)
85 if (namelist
->sym
->attr
.referenced
)
87 tree node
= build_omp_clause (where
.lb
->location
);
88 node
->omp_clause
.subcode
.reduction_code
= reduction_code
;
89 gfc_trans_omp_array_reduction (namelist
->sym
, where
);
94 gfc_trans_omp_clauses (stmtblock_t
* block
, gfc_omp_clauses
* clauses
,
97 tree omp_clauses
= (tree
) ((void *) 0);
99 for (list
= 0; list
< OMP_LIST_NUM
; list
++)
101 gfc_namelist
*n
= clauses
->lists
[list
];
102 enum tree_code reduction_code
;
103 if (n
== ((void *) 0))
108 reduction_code
= MULT_EXPR
;
111 reduction_code
= MINUS_EXPR
;
113 gfc_trans_omp_reduction_list (n
, omp_clauses
, reduction_code
, where
);
118 gfc_trans_omp_parallel_workshare (gfc_code
* code
)
121 gfc_trans_omp_clauses (&block
, code
->ext
.omp_clauses
, code
->loc
);