From: Janus Weil Date: Mon, 25 Mar 2019 19:58:04 +0000 (+0100) Subject: re PR fortran/71861 ([F03] ICE in write_symbol(): bad module symbol) X-Git-Tag: releases/gcc-7.5.0~518 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eafa1d853a90d7e247f65e0a7c25ce26e6820141;p=thirdparty%2Fgcc.git re PR fortran/71861 ([F03] ICE in write_symbol(): bad module symbol) fix PR 71861 2019-03-25 Janus Weil PR fortran/71861 * symbol.c (check_conflict): ABSTRACT attribute conflicts with INTRINSIC attribute. 2019-03-25 Janus Weil PR fortran/71861 * gfortran.dg/interface_abstract_5.f90: New test case. From-SVN: r269922 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 67e0922adba0..03ae0852d418 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2019-03-25 Janus Weil + + PR fortran/71861 + Backport from trunk + * symbol.c (check_conflict): ABSTRACT attribute conflicts with + INTRINSIC attribute. + 2019-03-23 Thomas Koenig PR fortran/68009 diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index d42f2ed5bee9..44e15d039f41 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -509,6 +509,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) conf (external, intrinsic); conf (entry, intrinsic); + conf (abstract, intrinsic); if ((attr->if_source == IFSRC_DECL && !attr->procedure) || attr->contained) conf (external, subroutine); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6bff0f9f4e87..4ca1066d91a9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-03-25 Janus Weil + + PR fortran/71861 + Backport from trunk + * gfortran.dg/interface_abstract_5.f90: New test case. + 2019-03-21 Thomas Schwinge PR fortran/56408 diff --git a/gcc/testsuite/gfortran.dg/interface_abstract_5.f90 b/gcc/testsuite/gfortran.dg/interface_abstract_5.f90 new file mode 100644 index 000000000000..fddf6b89d277 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/interface_abstract_5.f90 @@ -0,0 +1,32 @@ +! { dg-do compile } +! +! PR 71861: [7/8/9 Regression] [F03] ICE in write_symbol(): bad module symbol +! +! Contributed by Gerhard Steinmetz + +module m1 + intrinsic abs + abstract interface + function abs(x) ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" } + real :: abs, x + end + end interface +end + +module m2 + abstract interface + function abs(x) + real :: abs, x + end + end interface + intrinsic abs ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" } +end + +module m3 + abstract interface + function f(x) + real :: f, x + end + end interface + intrinsic f ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" } +end