aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/module.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/module.cc')
-rw-r--r--gcc/fortran/module.cc25
1 files changed, 21 insertions, 4 deletions
diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc
index 070b316..c489dec 100644
--- a/gcc/fortran/module.cc
+++ b/gcc/fortran/module.cc
@@ -2093,7 +2093,7 @@ enum ab_attribute
AB_OACC_DECLARE_COPYIN, AB_OACC_DECLARE_DEVICEPTR,
AB_OACC_DECLARE_DEVICE_RESIDENT, AB_OACC_DECLARE_LINK,
AB_OMP_DECLARE_TARGET_LINK, AB_PDT_KIND, AB_PDT_LEN, AB_PDT_TYPE,
- AB_PDT_TEMPLATE, AB_PDT_ARRAY, AB_PDT_STRING,
+ AB_PDT_COMP, AB_PDT_TEMPLATE, AB_PDT_ARRAY, AB_PDT_STRING,
AB_OACC_ROUTINE_LOP_GANG, AB_OACC_ROUTINE_LOP_WORKER,
AB_OACC_ROUTINE_LOP_VECTOR, AB_OACC_ROUTINE_LOP_SEQ,
AB_OACC_ROUTINE_NOHOST,
@@ -2172,6 +2172,7 @@ static const mstring attr_bits[] =
minit ("PDT_TEMPLATE", AB_PDT_TEMPLATE),
minit ("PDT_ARRAY", AB_PDT_ARRAY),
minit ("PDT_STRING", AB_PDT_STRING),
+ minit ("PDT_COMP", AB_PDT_COMP),
minit ("OACC_ROUTINE_LOP_GANG", AB_OACC_ROUTINE_LOP_GANG),
minit ("OACC_ROUTINE_LOP_WORKER", AB_OACC_ROUTINE_LOP_WORKER),
minit ("OACC_ROUTINE_LOP_VECTOR", AB_OACC_ROUTINE_LOP_VECTOR),
@@ -2404,6 +2405,8 @@ mio_symbol_attribute (symbol_attribute *attr)
MIO_NAME (ab_attribute) (AB_PDT_LEN, attr_bits);
if (attr->pdt_type)
MIO_NAME (ab_attribute) (AB_PDT_TYPE, attr_bits);
+ if (attr->pdt_comp)
+ MIO_NAME (ab_attribute) (AB_PDT_COMP , attr_bits);
if (attr->pdt_template)
MIO_NAME (ab_attribute) (AB_PDT_TEMPLATE, attr_bits);
if (attr->pdt_array)
@@ -2681,6 +2684,9 @@ mio_symbol_attribute (symbol_attribute *attr)
case AB_PDT_TYPE:
attr->pdt_type = 1;
break;
+ case AB_PDT_COMP:
+ attr->pdt_comp = 1;
+ break;
case AB_PDT_TEMPLATE:
attr->pdt_template = 1;
break;
@@ -3622,7 +3628,9 @@ static const mstring expr_types[] = {
minit ("ARRAY", EXPR_ARRAY),
minit ("NULL", EXPR_NULL),
minit ("COMPCALL", EXPR_COMPCALL),
- minit (NULL, -1)
+ minit ("PPC", EXPR_PPC),
+ minit ("CONDITIONAL", EXPR_CONDITIONAL),
+ minit (NULL, -1),
};
/* INTRINSIC_ASSIGN is missing because it is used as an index for
@@ -3843,6 +3851,12 @@ mio_expr (gfc_expr **ep)
break;
+ case EXPR_CONDITIONAL:
+ mio_expr (&e->value.conditional.condition);
+ mio_expr (&e->value.conditional.true_expr);
+ mio_expr (&e->value.conditional.false_expr);
+ break;
+
case EXPR_FUNCTION:
mio_symtree_ref (&e->symtree);
mio_actual_arglist (&e->value.function.actual, false);
@@ -7277,10 +7291,13 @@ create_int_parameter_array (const char *name, int size, gfc_expr *value,
tmp_symtree = gfc_find_symtree (gfc_current_ns->sym_root, name);
if (tmp_symtree != NULL)
{
- if (strcmp (modname, tmp_symtree->n.sym->module) == 0)
+ if (tmp_symtree->n.sym->module &&
+ strcmp (modname, tmp_symtree->n.sym->module) == 0)
return;
else
- gfc_error ("Symbol %qs already declared", name);
+ gfc_error ("Symbol %qs already declared at %L conflicts with "
+ "symbol in %qs at %C", name,
+ &tmp_symtree->n.sym->declared_at, modname);
}
gfc_get_sym_tree (name, gfc_current_ns, &tmp_symtree, false);