[Bug fortran/86116] [6/7/8/9 Regression] Ambiguous generic interface not recognised

2018-09-07 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86116

janus at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #8 from janus at gcc dot gnu.org ---
Fixed on 9-trunk and the release branches. The fix will be included in the
upcoming releases 6.5, 7.4, 8.3 and 9.0. Closing.

[Bug fortran/86116] [6/7/8/9 Regression] Ambiguous generic interface not recognised

2018-09-07 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86116

--- Comment #7 from janus at gcc dot gnu.org ---
Author: janus
Date: Fri Sep  7 18:01:23 2018
New Revision: 264162

URL: https://gcc.gnu.org/viewcvs?rev=264162&root=gcc&view=rev
Log:
2018-09-07  Janus Weil  

Backported from trunk
PR fortran/86116
* interface.c (compare_type): Remove a CLASS/TYPE check.
(compare_type_characteristics): New function that behaves like the old
'compare_type'.
(gfc_check_dummy_characteristics, gfc_check_result_characteristics):
Call 'compare_type_characteristics' instead of 'compare_type'.

2018-09-07  Janus Weil  

Backported from trunk
PR fortran/86116
* gfortran.dg/generic_34.f90: New test case.

Added:
branches/gcc-6-branch/gcc/testsuite/gfortran.dg/generic_34.f90
Modified:
branches/gcc-6-branch/gcc/fortran/ChangeLog
branches/gcc-6-branch/gcc/fortran/interface.c
branches/gcc-6-branch/gcc/testsuite/ChangeLog

[Bug fortran/86116] [6/7/8/9 Regression] Ambiguous generic interface not recognised

2018-09-07 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86116

--- Comment #6 from janus at gcc dot gnu.org ---
Author: janus
Date: Fri Sep  7 17:33:15 2018
New Revision: 264161

URL: https://gcc.gnu.org/viewcvs?rev=264161&root=gcc&view=rev
Log:
2018-09-07  Janus Weil  

Backported from trunk
PR fortran/86116
* interface.c (compare_type): Remove a CLASS/TYPE check.
(compare_type_characteristics): New function that behaves like the old
'compare_type'.
(gfc_check_dummy_characteristics, gfc_check_result_characteristics):
Call 'compare_type_characteristics' instead of 'compare_type'.

2018-09-07  Janus Weil  

Backported from trunk
PR fortran/86116
* gfortran.dg/generic_34.f90: New test case.

Added:
branches/gcc-7-branch/gcc/testsuite/gfortran.dg/generic_34.f90
Modified:
branches/gcc-7-branch/gcc/fortran/ChangeLog
branches/gcc-7-branch/gcc/fortran/interface.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog

[Bug fortran/86116] [6/7/8/9 Regression] Ambiguous generic interface not recognised

2018-09-05 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86116

--- Comment #5 from janus at gcc dot gnu.org ---
Author: janus
Date: Wed Sep  5 19:22:53 2018
New Revision: 264131

URL: https://gcc.gnu.org/viewcvs?rev=264131&root=gcc&view=rev
Log:
2018-09-05  Janus Weil  

Backported from trunk
PR fortran/86116
* interface.c (compare_type): Remove a CLASS/TYPE check.
(compare_type_characteristics): New function that behaves like the old
'compare_type'.
(gfc_check_dummy_characteristics, gfc_check_result_characteristics):
Call 'compare_type_characteristics' instead of 'compare_type'.

2018-09-05  Janus Weil  

Backported from trunk
PR fortran/86116
* gfortran.dg/generic_34.f90: New test case.

Added:
branches/gcc-8-branch/gcc/testsuite/gfortran.dg/generic_34.f90
Modified:
branches/gcc-8-branch/gcc/fortran/ChangeLog
branches/gcc-8-branch/gcc/fortran/interface.c
branches/gcc-8-branch/gcc/testsuite/ChangeLog

[Bug fortran/86116] [6/7/8/9 Regression] Ambiguous generic interface not recognised

2018-08-14 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86116

--- Comment #4 from janus at gcc dot gnu.org ---
Author: janus
Date: Tue Aug 14 19:09:33 2018
New Revision: 263540

URL: https://gcc.gnu.org/viewcvs?rev=263540&root=gcc&view=rev
Log:
2018-08-14  Janus Weil  

PR fortran/86116
* interface.c (compare_type): Remove a CLASS/TYPE check.
(compare_type_characteristics): New function that behaves like the old
'compare_type'.
(gfc_check_dummy_characteristics, gfc_check_result_characteristics):
Call 'compare_type_characteristics' instead of 'compare_type'.

2018-08-14  Janus Weil  

PR fortran/86116
* gfortran.dg/generic_34.f90: New test case.

Added:
trunk/gcc/testsuite/gfortran.dg/generic_34.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/interface.c
trunk/gcc/testsuite/ChangeLog

[Bug fortran/86116] [6/7/8/9 Regression] Ambiguous generic interface not recognised

2018-08-04 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86116

--- Comment #3 from janus at gcc dot gnu.org ---
Regtesting the patch in comment 2 shows the following failures:

FAIL: gfortran.dg/dummy_procedure_4.f90   -O   (test for errors, line 28)
FAIL: gfortran.dg/proc_ptr_30.f90   -O   (test for errors, line 25)
FAIL: gfortran.dg/proc_ptr_comp_32.f90   -O   (test for errors, line 34)
FAIL: gfortran.dg/proc_ptr_comp_33.f90   -O   (test for errors, line 14)
FAIL: gfortran.dg/proc_ptr_comp_33.f90   -O   (test for errors, line 54)

[Bug fortran/86116] [6/7/8/9 Regression] Ambiguous generic interface not recognised

2018-08-04 Thread janus at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86116

--- Comment #2 from janus at gcc dot gnu.org ---
The problem can be fixed by removing the following piece of code:


Index: gcc/fortran/interface.c
===
--- gcc/fortran/interface.c (revision 263308)
+++ gcc/fortran/interface.c (working copy)
@@ -735,12 +735,6 @@ compare_type (gfc_symbol *s1, gfc_symbol *s2)
   if (s2->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK))
 return true;

-  /* TYPE and CLASS of the same declared type are type compatible,
- but have different characteristics.  */
-  if ((s1->ts.type == BT_CLASS && s2->ts.type == BT_DERIVED)
-  || (s1->ts.type == BT_DERIVED && s2->ts.type == BT_CLASS))
-return false;
-
   return gfc_compare_types (&s1->ts, &s2->ts) || s2->ts.type == BT_ASSUMED;
 }


This was added by Tobias in r201329 (for PR 57530), which is certainly the
origin of the regression. Unfortunately the commit does not include a test
case, nevertheless I expect that the patch above will trigger some testsuite
regressions (but haven't checked yet).

[Bug fortran/86116] [6/7/8/9 Regression] Ambiguous generic interface not recognised

2018-06-13 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86116

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|UNCONFIRMED |NEW
  Known to work||4.8.5
   Keywords||accepts-invalid
   Last reconfirmed||2018-06-13
 Ever confirmed|0   |1
Summary|Ambiguous generic interface |[6/7/8/9 Regression]
   |not recognised  |Ambiguous generic interface
   ||not recognised
   Target Milestone|--- |6.5
  Known to fail||4.9.3, 5.5.0, 6.4.0, 7.3.0,
   ||8.1.0, 9.0

--- Comment #1 from Dominique d'Humieres  ---
Confirmed from 4.9.3 up to trunk (9.0), compiling the test with 4.8.5 gives

pr86116.f90:11.25:

  module procedure s2
 1
Error: Ambiguous interfaces 's2' and 's1' in generic interface 'sub' at (1)