Commit 74582a3e by Cesar Philippidis Committed by Cesar Philippidis

re PR fortran/77765 (ICE in gfc_match_oacc_routine, at fortran/openmp.c:1781)

	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
parent 6da4066f
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
......
......@@ -2295,7 +2295,8 @@ gfc_match_oacc_routine (void)
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.
......
! 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 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment