aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/trans-expr.c
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2019-12-18 16:34:06 +0000
committerHarald Anlauf <anlauf@gcc.gnu.org>2019-12-18 16:34:06 +0000
commit6573d760cdfec1b4577b268ce1ff19cecc4c9cbd (patch)
treef124dd019a09cfeeb03d29ba89a3711808104e9d /gcc/fortran/trans-expr.c
parente986ce3bd611f3887b4aa9fe1505436970478711 (diff)
downloadgcc-6573d760cdfec1b4577b268ce1ff19cecc4c9cbd.zip
gcc-6573d760cdfec1b4577b268ce1ff19cecc4c9cbd.tar.gz
gcc-6573d760cdfec1b4577b268ce1ff19cecc4c9cbd.tar.bz2
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
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r--gcc/fortran/trans-expr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index fe89c7b..eb3250a 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -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;