re PR fortran/33317 (CSHIFT/EOSHIFT: Rejects optional dummy for DIM=)

2007-11-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/33317
	* trans-expr.c (gfc_conv_missing_dummy): Revert.
	* iresolve.c (gfc_resolve_cshift): Revert.
	(gfc_resolve_eoshift): Likewise.
	* check.c (gfc_check_cshift): Revert.
	(gfc_check_eoshift): Likewise.

From-SVN: r130304
This commit is contained in:
Jerry DeLisle 2007-11-20 01:37:43 +00:00
parent 9fc1c58ff0
commit e76e6ce3ff
4 changed files with 29 additions and 18 deletions

View File

@ -1,3 +1,12 @@
2007-11-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/33317
* trans-expr.c (gfc_conv_missing_dummy): Revert.
* iresolve.c (gfc_resolve_cshift): Revert.
(gfc_resolve_eoshift): Likewise.
* check.c (gfc_check_cshift): Revert.
(gfc_check_eoshift): Likewise.
2007-11-19 Tobias Burnus <burnus@net-b.de>
PR fortran/34079

View File

@ -863,7 +863,8 @@ gfc_check_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
/* TODO: more requirements on shift parameter. */
}
if (dim_check (dim, 2, true) == FAILURE)
/* FIXME (PR33317): Allow optional DIM=. */
if (dim_check (dim, 2, false) == FAILURE)
return FAILURE;
return SUCCESS;
@ -1032,7 +1033,8 @@ gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
/* TODO: more restrictions on boundary. */
}
if (dim_check (dim, 4, true) == FAILURE)
/* FIXME (PR33317): Allow optional DIM=. */
if (dim_check (dim, 4, false) == FAILURE)
return FAILURE;
return SUCCESS;

View File

@ -583,9 +583,13 @@ gfc_resolve_cshift (gfc_expr *f, gfc_expr *array, gfc_expr *shift,
gfc_convert_type_warn (shift, &ts, 2, 0);
}
/* Mark this for later setting the type in gfc_conv_missing_dummy. */
if (dim != NULL && dim->symtree != NULL)
dim->symtree->n.sym->attr.untyped = 1;
if (dim != NULL)
{
gfc_resolve_dim_arg (dim);
/* Convert dim to shift's kind, so we don't need so many variations. */
if (dim->ts.kind != shift->ts.kind)
gfc_convert_type_warn (dim, &shift->ts, 2, 0);
}
f->value.function.name
= gfc_get_string (PREFIX ("cshift%d_%d%s"), n, shift->ts.kind,
@ -704,9 +708,13 @@ gfc_resolve_eoshift (gfc_expr *f, gfc_expr *array, gfc_expr *shift,
gfc_convert_type_warn (shift, &ts, 2, 0);
}
/* Mark this for later setting the type in gfc_conv_missing_dummy. */
if (dim != NULL && dim->symtree != NULL)
dim->symtree->n.sym->attr.untyped = 1;
if (dim != NULL)
{
gfc_resolve_dim_arg (dim);
/* Convert dim to shift's kind, so we don't need so many variations. */
if (dim->ts.kind != shift->ts.kind)
gfc_convert_type_warn (dim, &shift->ts, 2, 0);
}
f->value.function.name
= gfc_get_string (PREFIX ("eoshift%d_%d%s"), n, shift->ts.kind,

View File

@ -153,16 +153,8 @@ gfc_conv_missing_dummy (gfc_se * se, gfc_expr * arg, gfc_typespec ts)
present = gfc_conv_expr_present (arg->symtree->n.sym);
/* Make sure the type is at least default integer kind to match certain
runtime library functions. (ie cshift and eoshift). */
if (ts.type == BT_INTEGER && arg->symtree->n.sym->attr.untyped)
{
tmp = gfc_get_int_type (gfc_default_integer_kind);
tmp = fold_convert (tmp, se->expr);
}
else
tmp = build3 (COND_EXPR, TREE_TYPE (se->expr), present, se->expr,
fold_convert (TREE_TYPE (se->expr), integer_zero_node));
tmp = build3 (COND_EXPR, TREE_TYPE (se->expr), present, se->expr,
fold_convert (TREE_TYPE (se->expr), integer_zero_node));
tmp = gfc_evaluate_now (tmp, &se->pre);
se->expr = tmp;