* [PATCH] fortran/64925 -- fix conflict between names
@ 2015-05-15 14:55 Steve Kargl
2015-05-15 23:08 ` FX
0 siblings, 1 reply; 2+ messages in thread
From: Steve Kargl @ 2015-05-15 14:55 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 429 bytes --]
I've had the attached patch in my tree for a
long and have had no issues. Regression tested
numerous times on trunk. OK to commit?
2015-05-XX Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/64925
* symbol.c(check_conflict): Check for a conflict between a dummy
argument and an internal procedure name.
2015-05-XX Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/64925
* gfortran.dg/pr64925.f90: New test.
--
Steve
[-- Attachment #2: pr64925.diff --]
[-- Type: text/x-diff, Size: 1352 bytes --]
Index: gcc/fortran/symbol.c
===================================================================
--- gcc/fortran/symbol.c (revision 223094)
+++ gcc/fortran/symbol.c (working copy)
@@ -458,6 +458,11 @@ check_conflict (symbol_attribute *attr,
}
}
+ if (attr->dummy && ((attr->function || attr->subroutine) &&
+ gfc_current_state () == COMP_CONTAINS))
+ gfc_error_now ("internal procedure '%s' at %L conflicts with "
+ "DUMMY argument", name, where);
+
conf (dummy, entry);
conf (dummy, intrinsic);
conf (dummy, threadprivate);
Index: gcc/testsuite/gfortran.dg/pr64925.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr64925.f90 (revision 0)
+++ gcc/testsuite/gfortran.dg/pr64925.f90 (working copy)
@@ -0,0 +1,22 @@
+! { dg-do compile }
+! PR fortran/64925
+! Original test case provided by Bill Long <longb at cray dot com>
+!
+subroutine foo(nnn, aaa, bbb, ccc, ddd)
+ implicit none
+ integer :: nnn, aaa, bbb(nnn)
+ integer :: i
+ do i=1,nnn
+ aaa = aaa + bbb(ccc(i))
+ end do
+ call ddd(aaa)
+contains
+ integer function ccc(i) ! { dg-error "conflicts with DUMMY" }
+ integer :: i
+ ccc = i
+ end function ccc
+ subroutine ddd(j) ! { dg-error "conflicts with DUMMY" }
+ integer j
+ j = j + 1
+ end subroutine ddd
+end subroutine foo
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fortran/64925 -- fix conflict between names
2015-05-15 14:55 [PATCH] fortran/64925 -- fix conflict between names Steve Kargl
@ 2015-05-15 23:08 ` FX
0 siblings, 0 replies; 2+ messages in thread
From: FX @ 2015-05-15 23:08 UTC (permalink / raw)
To: Steve Kargl; +Cc: fortran, gcc-patches
> 2015-05-XX Steven G. Kargl <kargl@gcc.gnu.org>
>
> PR fortran/64925
> * symbol.c(check_conflict): Check for a conflict between a dummy
> argument and an internal procedure name.
>
> 2015-05-XX Steven G. Kargl <kargl@gcc.gnu.org>
>
> PR fortran/64925
> * gfortran.dg/pr64925.f90: New test.
OK
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-05-15 22:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15 14:55 [PATCH] fortran/64925 -- fix conflict between names Steve Kargl
2015-05-15 23:08 ` FX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).