http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55855
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org |gnu.org | --- Comment #4 from janus at gcc dot gnu.org 2013-01-03 15:33:38 UTC --- (In reply to comment #3) > (In reply to comment #1) > > The following draft patch seems to be sufficient to fix it: > > + && rvalue->expr_type == EXPR_FUNCTION > > + && gfc_expr_attr (rvalue).pointer) > > The patch is OK (obvious) with a test case. Thanks. I just checked that it is free of regressions, apart from a failure in assignment_1.f90, due to the changed error message (which I modified for orthographical reasons): Index: gcc/testsuite/gfortran.dg/assignment_1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/assignment_1.f90 (revision 194763) +++ gcc/testsuite/gfortran.dg/assignment_1.f90 (working copy) @@ -12,7 +12,7 @@ integer, target :: t, s t = 1 p => s ! We didn't dereference the pointer in the following line. -p = f() ! { dg-warning "POINTER valued function" "" } +p = f() ! { dg-warning "POINTER-valued function" "" } p = p+1 if (p.ne.2) call abort() if (p.ne.s) call abort() Will commit soon.