GCC Bugzilla – Attachment 12730 Details for
Bug 29975
[meta-bugs] ICEs with CP2K
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
This fixes the INTERFACE part of the problem.
pr29975_interface.diff (text/plain), 3.74 KB, created by
Paul Thomas
on 2006-12-03 13:38:38 UTC
(
hide
)
Description:
This fixes the INTERFACE part of the problem.
Filename:
MIME Type:
Creator:
Paul Thomas
Created:
2006-12-03 13:38:38 UTC
Size:
3.74 KB
patch
obsolete
>Index: gcc/fortran/symbol.c >=================================================================== >--- gcc/fortran/symbol.c (revision 119271) >+++ gcc/fortran/symbol.c (working copy) >@@ -1996,7 +1996,9 @@ > if (st != NULL) > { > *result = st; >- if (st->ambiguous) >+ /* Ambiguous generic interfaces are permitted, as long >+ as the specific interfaces are different. */ >+ if (st->ambiguous && !st->n.sym->attr.generic) > { > ambiguous_symbol (name, st); > return 1; >@@ -2097,8 +2099,10 @@ > } > else > { >- /* Make sure the existing symbol is OK. */ >- if (st->ambiguous) >+ /* Make sure the existing symbol is OK. Ambiguous >+ generic interfaces are permitted, as long as the >+ specific interfaces are different. */ >+ if (st->ambiguous && !st->n.sym->attr.generic) > { > ambiguous_symbol (name, st); > return 1; >Index: gcc/testsuite/gfortran.dg/interface_x.f90 >=================================================================== >--- gcc/testsuite/gfortran.dg/interface_x.f90 (revision 0) >+++ gcc/testsuite/gfortran.dg/interface_x.f90 (revision 0) >@@ -0,0 +1,46 @@ >+! { dg-do run } >+! Tests the fix for the interface bit of PR29975, in which the >+! interfaces bl_copy were rejected as ambiguous, even though >+! they import different specific interfaces. >+! >+! Contributed by Joost VandeVondele <jv244@cam.ac.uk> and >+! simplified by Tobias Burnus <burnus@gcc.gnu.org> >+! >+SUBROUTINE RECOPY(N, c) >+ real, INTENT(IN) :: N >+ character(6) :: c >+ c = "recopy" >+END SUBROUTINE RECOPY >+ >+MODULE f77_blas_extra >+PUBLIC :: BL_COPY >+INTERFACE BL_COPY >+ MODULE PROCEDURE SDCOPY >+END INTERFACE BL_COPY >+CONTAINS >+ SUBROUTINE SDCOPY(N, c) >+ INTEGER, INTENT(IN) :: N >+ character(6) :: c >+ c = "sdcopy" >+ END SUBROUTINE SDCOPY >+END MODULE f77_blas_extra >+ >+MODULE f77_blas_generic >+INTERFACE BL_COPY >+ SUBROUTINE RECOPY(N, c) >+ real, INTENT(IN) :: N >+ character(6) :: c >+ END SUBROUTINE RECOPY >+END INTERFACE BL_COPY >+END MODULE f77_blas_generic >+ >+program main >+ USE f77_blas_extra >+ USE f77_blas_generic >+ character(6) :: chr >+ call bl_copy(1, chr) >+ if (chr /= "sdcopy") call abort () >+ call bl_copy(1.0, chr) >+ if (chr /= "recopy") call abort () >+end program main >+! { dg-final { cleanup-modules "f77_blas_generic f77_blas_extra" } } >Index: gcc/testsuite/gfortran.dg/interface_y.f90 >=================================================================== >--- gcc/testsuite/gfortran.dg/interface_y.f90 (revision 0) >+++ gcc/testsuite/gfortran.dg/interface_y.f90 (revision 0) >@@ -0,0 +1,45 @@ >+! { dg-do compile } >+! Tests the fix for the interface bit of PR29975, in which the >+! interfaces bl_copy were rejected as ambiguous, even though >+! they import different specific interfaces. In this testcase, >+! it is verified that ambiguous specific interfaces are caught. >+! >+! Contributed by Joost VandeVondele <jv244@cam.ac.uk> and >+! simplified by Tobias Burnus <burnus@gcc.gnu.org> >+! >+SUBROUTINE RECOPY(N, c) >+ real, INTENT(IN) :: N >+ character(6) :: c >+ c = "recopy" >+END SUBROUTINE RECOPY >+ >+MODULE f77_blas_extra >+PUBLIC :: BL_COPY >+INTERFACE BL_COPY >+ MODULE PROCEDURE SDCOPY >+END INTERFACE BL_COPY >+CONTAINS >+ SUBROUTINE SDCOPY(N, c) >+ REAL, INTENT(IN) :: N >+ character(6) :: c >+ c = "sdcopy" >+ END SUBROUTINE SDCOPY >+END MODULE f77_blas_extra >+ >+MODULE f77_blas_generic >+INTERFACE BL_COPY >+ SUBROUTINE RECOPY(N, c) >+ real, INTENT(IN) :: N >+ character(6) :: c >+ END SUBROUTINE RECOPY >+END INTERFACE BL_COPY >+END MODULE f77_blas_generic >+ >+program main >+ USE f77_blas_extra ! { dg-error "Ambiguous|interfaces" } >+ USE f77_blas_generic >+ character(6) :: chr >+ call bl_copy(1.0, chr) >+ if (chr /= "recopy") call abort () >+end program main >+! { dg-final { cleanup-modules "f77_blas_generic f77_blas_extra" } }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 29975
:
12722
|
12724
|
12730
|
12733
|
12777