aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/gfortran.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/gfortran.h')
-rw-r--r--gcc/fortran/gfortran.h64
1 files changed, 57 insertions, 7 deletions
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 4e1da8c..559d3c6 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -263,7 +263,7 @@ enum gfc_statement
ST_OMP_TARGET_SIMD, ST_OMP_END_TARGET_SIMD,
ST_OMP_TASKLOOP, ST_OMP_END_TASKLOOP,
ST_OMP_TASKLOOP_SIMD, ST_OMP_END_TASKLOOP_SIMD, ST_OMP_ORDERED_DEPEND,
- ST_PROCEDURE, ST_GENERIC, ST_CRITICAL, ST_END_CRITICAL,
+ ST_OMP_REQUIRES, ST_PROCEDURE, ST_GENERIC, ST_CRITICAL, ST_END_CRITICAL,
ST_GET_FCN_CHARACTERISTICS, ST_LOCK, ST_UNLOCK, ST_EVENT_POST,
ST_EVENT_WAIT, ST_FAIL_IMAGE, ST_FORM_TEAM, ST_CHANGE_TEAM,
ST_END_TEAM, ST_SYNC_TEAM, ST_NONE
@@ -1107,7 +1107,6 @@ typedef struct gfc_component
struct gfc_typebound_proc *tb;
/* When allocatable/pointer and in a coarray the associated token. */
tree caf_token;
- bool finalized;
}
gfc_component;
@@ -1243,6 +1242,7 @@ typedef struct gfc_omp_namelist
gfc_omp_map_op map_op;
gfc_omp_linear_op linear_op;
struct gfc_common_head *common;
+ bool lastprivate_conditional;
} u;
struct gfc_omp_namelist_udr *udr;
struct gfc_omp_namelist *next;
@@ -1276,6 +1276,7 @@ enum
OMP_LIST_IS_DEVICE_PTR,
OMP_LIST_USE_DEVICE_PTR,
OMP_LIST_USE_DEVICE_ADDR,
+ OMP_LIST_NONTEMPORAL,
OMP_LIST_NUM
};
@@ -1321,7 +1322,9 @@ enum gfc_omp_cancel_kind
enum gfc_omp_if_kind
{
+ OMP_IF_CANCEL,
OMP_IF_PARALLEL,
+ OMP_IF_SIMD,
OMP_IF_TASK,
OMP_IF_TASKLOOP,
OMP_IF_TARGET,
@@ -1332,6 +1335,24 @@ enum gfc_omp_if_kind
OMP_IF_LAST
};
+enum gfc_omp_requires_kind
+{
+ /* Keep in sync with gfc_namespace, esp. with omp_req_mem_order. */
+ OMP_REQ_ATOMIC_MEM_ORDER_SEQ_CST = 1, /* 01 */
+ OMP_REQ_ATOMIC_MEM_ORDER_ACQ_REL = 2, /* 10 */
+ OMP_REQ_ATOMIC_MEM_ORDER_RELAXED = 3, /* 11 */
+ OMP_REQ_REVERSE_OFFLOAD = (1 << 2),
+ OMP_REQ_UNIFIED_ADDRESS = (1 << 3),
+ OMP_REQ_UNIFIED_SHARED_MEMORY = (1 << 4),
+ OMP_REQ_DYNAMIC_ALLOCATORS = (1 << 5),
+ OMP_REQ_TARGET_MASK = (OMP_REQ_REVERSE_OFFLOAD
+ | OMP_REQ_UNIFIED_ADDRESS
+ | OMP_REQ_UNIFIED_SHARED_MEMORY),
+ OMP_REQ_ATOMIC_MEM_ORDER_MASK = (OMP_REQ_ATOMIC_MEM_ORDER_SEQ_CST
+ | OMP_REQ_ATOMIC_MEM_ORDER_ACQ_REL
+ | OMP_REQ_ATOMIC_MEM_ORDER_RELAXED)
+};
+
typedef struct gfc_omp_clauses
{
struct gfc_expr *if_expr;
@@ -1345,7 +1366,7 @@ typedef struct gfc_omp_clauses
bool nowait, ordered, untied, mergeable;
bool inbranch, notinbranch, defaultmap, nogroup;
bool sched_simd, sched_monotonic, sched_nonmonotonic;
- bool simd, threads, depend_source;
+ bool simd, threads, depend_source, order_concurrent;
enum gfc_omp_cancel_kind cancel;
enum gfc_omp_proc_bind_kind proc_bind;
struct gfc_expr *safelen_expr;
@@ -1621,7 +1642,10 @@ typedef struct gfc_symbol
/* Set if the symbol is used in a function result specification . */
unsigned fn_result_spec:1;
/* Used to avoid multiple resolutions of a single symbol. */
- unsigned resolved:1;
+ /* = 2 if this has already been resolved as an intrinsic,
+ in gfc_resolve_intrinsic,
+ = 1 if it has been resolved in resolve_symbol. */
+ unsigned resolve_symbol_called:2;
/* Set if this is a module function or subroutine with the
abreviated declaration in a submodule. */
unsigned abr_modproc_decl:1;
@@ -1675,7 +1699,8 @@ typedef struct gfc_common_head
char use_assoc, saved, threadprivate;
unsigned char omp_declare_target : 1;
unsigned char omp_declare_target_link : 1;
- char name[GFC_MAX_SYMBOL_LEN + 1];
+ /* Provide sufficient space to hold "symbol.symbol.eq.1234567890". */
+ char name[2*GFC_MAX_SYMBOL_LEN + 1 + 14 + 1];
struct gfc_symbol *head;
const char* binding_label;
int is_bind_c;
@@ -1771,6 +1796,16 @@ gfc_oacc_routine_name;
#define gfc_get_oacc_routine_name() XCNEW (gfc_oacc_routine_name)
+/* Node in linked list to see what has already been finalized
+ earlier. */
+
+typedef struct gfc_was_finalized {
+ gfc_expr *e;
+ gfc_component *c;
+ struct gfc_was_finalized *next;
+}
+gfc_was_finalized;
+
/* A namespace describes the contents of procedure, module, interface block
or BLOCK construct. */
/* ??? Anything else use these? */
@@ -1863,6 +1898,11 @@ typedef struct gfc_namespace
/* Linked list of !$omp declare simd constructs. */
struct gfc_omp_declare_simd *omp_declare_simd;
+ /* A hash set for the the gfc expressions that have already
+ been finalized in this namespace. */
+
+ gfc_was_finalized *was_finalized;
+
/* Set to 1 if namespace is a BLOCK DATA program unit. */
unsigned is_block_data:1;
@@ -1894,6 +1934,10 @@ typedef struct gfc_namespace
/* Set to 1 if there are any calls to procedures with implicit interface. */
unsigned implicit_interface_calls:1;
+
+ /* OpenMP requires. */
+ unsigned omp_requires:6;
+ unsigned omp_target_seen:1;
}
gfc_namespace;
@@ -2624,7 +2668,8 @@ enum gfc_omp_atomic_op
GFC_OMP_ATOMIC_CAPTURE = 3,
GFC_OMP_ATOMIC_MASK = 3,
GFC_OMP_ATOMIC_SEQ_CST = 4,
- GFC_OMP_ATOMIC_SWAP = 8
+ GFC_OMP_ATOMIC_ACQ_REL = 8,
+ GFC_OMP_ATOMIC_SWAP = 16
};
typedef struct gfc_code
@@ -2913,7 +2958,7 @@ void gfc_clear_ts (gfc_typespec *);
FILE *gfc_open_file (const char *);
const char *gfc_basic_typename (bt);
const char *gfc_dummy_typename (gfc_typespec *);
-const char *gfc_typename (gfc_typespec *);
+const char *gfc_typename (gfc_typespec *, bool for_hash = false);
const char *gfc_typename (gfc_expr *);
const char *gfc_op2string (gfc_intrinsic_op);
const char *gfc_code2string (const mstring *, int);
@@ -3249,6 +3294,9 @@ gfc_expr *gfc_get_parentheses (gfc_expr *);
/* openmp.c */
struct gfc_omp_saved_state { void *ptrs[2]; int ints[1]; };
+bool gfc_omp_requires_add_clause (gfc_omp_requires_kind, const char *,
+ locus *, const char *);
+void gfc_check_omp_requires (gfc_namespace *, int);
void gfc_free_omp_clauses (gfc_omp_clauses *);
void gfc_free_oacc_declare_clauses (struct gfc_oacc_declare *);
void gfc_free_omp_declare_simd (gfc_omp_declare_simd *);
@@ -3547,6 +3595,7 @@ bool gfc_calculate_transfer_sizes (gfc_expr*, gfc_expr*, gfc_expr*,
bool gfc_boz2int (gfc_expr *, int);
bool gfc_boz2real (gfc_expr *, int);
bool gfc_invalid_boz (const char *, locus *);
+bool gfc_invalid_null_arg (gfc_expr *);
/* class.c */
@@ -3604,6 +3653,7 @@ int gfc_expr_walker (gfc_expr **, walk_expr_fn_t, void *);
int gfc_code_walker (gfc_code **, walk_code_fn_t, walk_expr_fn_t, void *);
bool gfc_has_dimen_vector_ref (gfc_expr *e);
void gfc_check_externals (gfc_namespace *);
+bool gfc_fix_implicit_pure (gfc_namespace *);
/* simplify.c */