This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50570] [4.6/4.7 Regression] Incorrect error for assignment to intent(in) pointer
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 09 Oct 2011 23:26:45 +0000
- Subject: [Bug fortran/50570] [4.6/4.7 Regression] Incorrect error for assignment to intent(in) pointer
- Auto-submitted: auto-generated
- References: <bug-50570-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50570
--- Comment #8 from janus at gcc dot gnu.org 2011-10-09 23:26:45 UTC ---
(In reply to comment #7)
> > > > How about this?
> > >
> > > Looks as if should work (for comment 0).
> >
> > It does. I'll check for regressions.
>
> Unfortunately it fails on:
>
> FAIL: gfortran.dg/pointer_intent_1.f90 -O0 (test for excess errors)
> FAIL: gfortran.dg/pointer_intent_3.f90 -O (test for excess errors)
> FAIL: gfortran.dg/pointer_intent_4.f90 -O0 (test for excess errors)
The following variant avoids these regressions:
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 179729)
+++ gcc/fortran/expr.c (working copy)
@@ -4635,7 +4635,7 @@ gfc_check_vardef_context (gfc_expr* e, bool pointe
sym->name, context, &e->where);
return FAILURE;
}
- if (!pointer && !is_pointer)
+ if (!pointer && !is_pointer && !sym->attr.pointer)
{
if (context)
gfc_error ("Dummy argument '%s' with INTENT(IN) in variable"