[Bug fortran/109684] New: compiling failure: complaining about a final subroutine of a type being not PURE (while it is indeed PURE)

2023-05-01 Thread wangmianzhi1 at linuxmail dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109684

Bug ID: 109684
   Summary: compiling failure: complaining about a final
subroutine of a type being not PURE (while it is
indeed PURE)
   Product: gcc
   Version: 13.1.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: wangmianzhi1 at linuxmail dot org
  Target Milestone: ---

Created attachment 54964
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54964&action=edit
build with cmake

This issue emerges after upgrading to Fedora 38 (gcc version 13.1.1 20230426)
from Fedora 37 (gcc 12.x series). There was no issue in Fedora 37.

The issue takes place when:
mkdir build; cd build; cmake ..; make

GCC would popup an error message like this:
/home/mianzhi/Desktop/final_subroutine_not_pure/src/test/basicFEM1.f90:3:0:

3 | function basicFEM1() result(ierr)
  | 
Error: Contained procedure ‘__final_modotgrid_Otgrid’ at (1) of a PURE
procedure must also be PURE

The f90 file that actually contains the otGrid type with its final procedure
compiles fine. The basicFEM1.f90 uses module modFileIO, which has an interface
that involves type otGrid.

The attached is a stripped-down version of the code. I've tried to further
simplify the code but removing seemingly irrelevant things could prevent the
error from happening.

Thank you very much for your help.

Best regards,
Mianzhi

[Bug fortran/109684] compiling failure: complaining about a final subroutine of a type being not PURE (while it is indeed PURE)

2023-05-17 Thread wangmianzhi1 at linuxmail dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109684

Mianzhi Wang  changed:

   What|Removed |Added

  Attachment #54964|0   |1
is obsolete||
 CC||wangmianzhi1 at linuxmail dot 
org

--- Comment #1 from Mianzhi Wang  ---
Created attachment 55103
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55103&action=edit
slightly more simplified

build with cmake