Commit a26f63a8 by Steven G. Kargl

re PR fortran/84511 (Internal compiler error from directly printing return of C_LOC)

2018-02-23  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/84511
	* trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.

From-SVN: r257943
parent 3453b6aa
2018-02-23 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/84511
* trans-io.c (transfer_expr): Deal with C_LOC in transfer statement.
2018-02-23 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/84346
* interface.c (compare_actual_formal): Issue error if keyword is
used in a statement function.
......
......@@ -2289,6 +2289,16 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr,
ts->kind = gfc_index_integer_kind;
}
/* gfortran reaches here for "print *, c_loc(xxx)". */
if (ts->type == BT_VOID
&& code->expr1 && code->expr1->ts.type == BT_VOID
&& code->expr1->symtree
&& strcmp (code->expr1->symtree->name, "c_loc") == 0)
{
ts->type = BT_INTEGER;
ts->kind = gfc_index_integer_kind;
}
kind = ts->kind;
function = NULL;
arg2 = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment