diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index befa318e0e9..f3238863fa2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2007-06-22 Jerry DeLisle + + PR fortran/32360 + * expr.c (gfc_check_assign): If the rvalue expression type is NULL_EXPR, + check to see if the lvalue has attribute pointer and data. + 2007-06-21 Jerry DeLisle PR fortran/31162 diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 00ed9a04d77..d3f0ddf5cce 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2407,12 +2407,18 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform) return FAILURE; } - if (rvalue->expr_type == EXPR_NULL) - { - gfc_error ("NULL appears on right-hand side in assignment at %L", - &rvalue->where); - return FAILURE; - } + if (rvalue->expr_type == EXPR_NULL) + { + if (lvalue->symtree->n.sym->attr.pointer + && lvalue->symtree->n.sym->attr.data) + return SUCCESS; + else + { + gfc_error ("NULL appears on right-hand side in assignment at %L", + &rvalue->where); + return FAILURE; + } + } if (sym->attr.cray_pointee && lvalue->ref != NULL