Commit 6573d760 by Harald Anlauf Committed by Harald Anlauf

re PR fortran/70853 (ICE on pointing to null, in gfc_add_block_to_block, at fortran/trans.c:1599)

2019-12-18  Harald Anlauf  <anlauf@gmx.de>

	PR fortran/70853
	* trans-expr.c (gfc_trans_pointer_assignment): Reject bounds
	remapping if pointer target is NULL().

	PR fortran/70853
	* gfortran.dg/pr70853.f90: New test.

From-SVN: r279527
parent e986ce3b
2019-12-18 Harald Anlauf <anlauf@gmx.de>
PR fortran/70853
* trans-expr.c (gfc_trans_pointer_assignment): Reject bounds
remapping if pointer target is NULL().
2019-12-12 Harald Anlauf <anlauf@gmx.de>
PR fortran/92898
......
......@@ -9218,6 +9218,13 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
break;
rank_remap = (remap && remap->u.ar.end[0]);
if (remap && expr2->expr_type == EXPR_NULL)
{
gfc_error ("If bounds remapping is specified at %L, "
"the pointer target shall not be NULL", &expr1->where);
return NULL_TREE;
}
gfc_init_se (&lse, NULL);
if (remap)
lse.descriptor_only = 1;
......
2019-12-18 Harald Anlauf <anlauf@gmx.de>
PR fortran/70853
* gfortran.dg/pr70853.f90: New test.
2019-12-18 Martin Jambor <mjambor@suse.cz>
PR ipa/92971
......
! { dg-do compile }
! PR fortran/70853
! Contributed by Gerhard Steinmetz
program p
real, pointer :: z(:)
z(1:2) => null() ! { dg-error "pointer target shall not be NULL" }
z(2:1) => null() ! { dg-error "pointer target shall not be NULL" }
end
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