aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2025-02-15 11:38:05 +0100
committerThomas Koenig <tkoenig@gcc.gnu.org>2025-02-15 11:39:51 +0100
commitfd00010ba21c04bddb20aef52f62de5636075067 (patch)
tree655e0fe2ad89709d0e9da08bf50d69e903cc5adb /gcc
parent8f386aadec70624f13b48dfddc4a8f689ccc505f (diff)
downloadgcc-fd00010ba21c04bddb20aef52f62de5636075067.zip
gcc-fd00010ba21c04bddb20aef52f62de5636075067.tar.gz
gcc-fd00010ba21c04bddb20aef52f62de5636075067.tar.bz2
Fix PR 118884, Lapack build failure.
The fix for PR 118845 introduced new checks, which in turn exposed a case where the typespec information on a symbol generated symbol was not set. This led to an apparent type of BT_UNKNOWN, and hence an error. Fixed as obvoius and simple. gcc/fortran/ChangeLog: * frontend-passes.cc (check_externals_procedure): Copy typespec from old to new symbol. gcc/testsuite/ChangeLog: * gfortran.dg/interface_54.f90: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/frontend-passes.cc1
-rw-r--r--gcc/testsuite/gfortran.dg/interface_54.f9012
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/frontend-passes.cc b/gcc/fortran/frontend-passes.cc
index 6b470b8..20bf6e1 100644
--- a/gcc/fortran/frontend-passes.cc
+++ b/gcc/fortran/frontend-passes.cc
@@ -5727,6 +5727,7 @@ check_externals_procedure (gfc_symbol *sym, locus *loc,
gcc_assert (new_sym);
new_sym->attr = sym->attr;
new_sym->attr.if_source = IFSRC_DECL;
+ new_sym->ts = sym->ts;
gfc_current_ns = gsym->ns;
gfc_get_formal_from_actual_arglist (new_sym, actual);
diff --git a/gcc/testsuite/gfortran.dg/interface_54.f90 b/gcc/testsuite/gfortran.dg/interface_54.f90
new file mode 100644
index 0000000..98318ca
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/interface_54.f90
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! PR 118884 - this used to be rejected due to confused interface
+! checking.
+
+subroutine cget24
+ external cslect
+ logical cslect
+
+ call cgeesx(cslect)
+ if( cslect() ) print *,"foo"
+ call cgeesx(cslect)
+end subroutine cget24