PR fortran/77765
gcc/fortran/
* openmp.c (gfc_match_oacc_routine): Check if proc_name exist before
comparing the routine name against it.
gcc/testsuite/
* gfortran.dg/goacc/pr77765.f90: New test.
From-SVN: r249809
+2017-06-29 Cesar Philippidis <cesar@codesourcery.com>
+
+ PR fortran/77765
+ * openmp.c (gfc_match_oacc_routine): Check if proc_name exist before
+ comparing the routine name against it.
+
2017-06-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/80164
if (st)
{
sym = st->n.sym;
- if (strcmp (sym->name, gfc_current_ns->proc_name->name) == 0)
+ if (gfc_current_ns->proc_name != NULL
+ && strcmp (sym->name, gfc_current_ns->proc_name->name) == 0)
sym = NULL;
}
+2017-06-29 Cesar Philippidis <cesar@codesourcery.com>
+
+ PR fortran/77765
+ * gfortran.dg/goacc/pr77765.f90: New test.
+
2017-06-29 Steve Ellcey <sellcey@cavium.com>
* gcc.target/aarch64/ccmp_2.c: New test.
--- /dev/null
+! Test the presence of an ACC ROUTINE directive inside a function
+! containg an error.
+
+! { dg-do compile }
+
+module m
+contains
+ recursive function f(x)
+ end function f
+ recursive function f(x)
+ !$acc routine (f)
+ end function f
+end module m
+
+! { dg-error "Procedure 'f' at .1. is already defined" "" { target *-*-* } 8 }
+! { dg-error "Duplicate RECURSIVE attribute specified" "" { target *-*-* } 8 }
+! { dg-error ".1." "" { target *-*-* } 10 }
+! { dg-error "Unexpected ..ACC ROUTINE" "" { target *-*-* } 11 }
+! { dg-error "Expecting END MODULE statement" "" { target *-*-* } 12 }