aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2007-06-22 16:21:23 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2007-06-22 16:21:23 +0000
commit37775e79ee9baac8d0037ac2fc30f386111a7a45 (patch)
treeab311255204b47848e5de074be7c88624214fb8c
parent9064c53336c60cb5f21d2c8551e707522d1a5575 (diff)
downloadgcc-37775e79ee9baac8d0037ac2fc30f386111a7a45.zip
gcc-37775e79ee9baac8d0037ac2fc30f386111a7a45.tar.gz
gcc-37775e79ee9baac8d0037ac2fc30f386111a7a45.tar.bz2
re PR fortran/32360 (GFORTRAN WON'T COMPILE 'DATA PTR1 /NULL ()/' WHEN PTR1 HAS POINTER ATTRIBUTE)
2007-06-22 Jerry DeLisle <jvdelisle@gcc.gnu.org> 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. From-SVN: r125949
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/expr.c18
2 files changed, 18 insertions, 6 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index befa318..f323886 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2007-06-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ 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 <jvdelisle@gcc.gnu.org>
PR fortran/31162
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 00ed9a0..d3f0ddf 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