aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-01-21 08:11:05 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2011-01-21 08:11:05 +0100
commit7f1f7ffb496174346fd73b93ebaf12ee4a26685f (patch)
tree6e02b59d4c41b375b547bed5abef4e9d88701409 /gcc/fortran
parent4312bb184ca46af155be765ab73d03b1e898bb65 (diff)
downloadgcc-7f1f7ffb496174346fd73b93ebaf12ee4a26685f.zip
gcc-7f1f7ffb496174346fd73b93ebaf12ee4a26685f.tar.gz
gcc-7f1f7ffb496174346fd73b93ebaf12ee4a26685f.tar.bz2
re PR fortran/47377 (internal compiler error: in fold_convert_loc, at fold-const.c:1906)
2011-01-21 Tobias Burnus <burnus@net-b.de> PR fortran/47377 * expr.c (gfc_check_pointer_assign): Reject expr data-targets without pointer attribute. 2011-01-21 Tobias Burnus <burnus@net-b.de> PR fortran/47377 * gfortran.dg/pointer_target_4.f90: New. From-SVN: r169079
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/expr.c9
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 8bf90a9..7ea9603 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-21 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47377
+ * expr.c (gfc_check_pointer_assign): Reject expr data-targets
+ without pointer attribute.
+
2011-01-18 Janus Weil <janus@gcc.gnu.org>
PR fortran/47240
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 3f1141a..bcc23fc 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3507,6 +3507,15 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
lvalue->symtree->n.sym->attr.subref_array_pointer = 1;
attr = gfc_expr_attr (rvalue);
+
+ if (rvalue->expr_type == EXPR_FUNCTION && !attr.pointer)
+ {
+ gfc_error ("Target expression in pointer assignment "
+ "at %L must deliver a pointer result",
+ &rvalue->where);
+ return FAILURE;
+ }
+
if (!attr.target && !attr.pointer)
{
gfc_error ("Pointer assignment target is neither TARGET "