aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorThomas Koenig <tkoenig@gcc.gnu.org>2020-07-11 19:16:16 +0200
committerThomas Koenig <tkoenig@gcc.gnu.org>2020-07-11 19:16:58 +0200
commit90efb2512d40f0a59b063aa0416a6d28849ee424 (patch)
tree25a87bfa6dd4ef26d7034e7b56110c594ca32a80 /gcc/fortran/interface.c
parent2ea10cbd66d02d4f0c100dd6f1081cadf5561c2c (diff)
downloadgcc-90efb2512d40f0a59b063aa0416a6d28849ee424.zip
gcc-90efb2512d40f0a59b063aa0416a6d28849ee424.tar.gz
gcc-90efb2512d40f0a59b063aa0416a6d28849ee424.tar.bz2
Fix ICE on warning with new interface check.
In the test case, there was a warning about INTENT where an EXTERNAL masked an interface in an outer scope, when the location of the symbol was not set, leading to an ICE. Two problems, two-part solution: It makes no sense to warn about INTENT for artificially generated formal argument lists, and the location should be set. gcc/fortran/ChangeLog: PR fortran/96073 * frontend-passes.c (check_externals_procedure): Add locus information for new_sym. * interface.c (gfc_check_dummy_characteristics): Do not warn about INTENT for artificially generated variables. gcc/testsuite/ChangeLog: PR fortran/96073 * gfortran.dg/interface_48.f90: New test.
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 0cc504f..e518209 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -1343,7 +1343,8 @@ gfc_check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
}
/* Check INTENT. */
- if (s1->attr.intent != s2->attr.intent)
+ if (s1->attr.intent != s2->attr.intent && !s1->attr.artificial
+ && !s2->attr.artificial)
{
snprintf (errmsg, err_len, "INTENT mismatch in argument '%s'",
s1->name);