[Bug fortran/85526] [6/7/8/9 regression] ICE when calling a (pure) function from inside another pure function

2018-04-26 Thread mail at pietrodelugas dot it
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85526

--- Comment #4 from Pietro Delugas  ---
a quick and dirty workaround is to move all the routines in the "leng"
interface at the bottom of the file. But some compilers do not accept this code
as valid. 

A better solution is to move  the leng subroutines in a module by their own and
import the interface.

[Bug fortran/85526] New: [6.4 regression] calling a (pure) function from inside another pure function may cause segmentation fault during compilation

2018-04-25 Thread mail at pietrodelugas dot it
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85526

Bug ID: 85526
   Summary: [6.4 regression] calling a (pure) function from inside
another  pure function may cause segmentation fault
during compilation
   Product: gcc
   Version: 6.4.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mail at pietrodelugas dot it
  Target Milestone: ---

Created attachment 44019
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44019=edit
fortran source file to demonstrate the bug

A call to a pure function from inside a pure function crashes the compilation
with this message 

internal compiler error: Segmentation fault

the same code has been compiling regularly with gfortran up to 6.2 while it is
failing in 6.4 and 7.3 versions 

I attach a sample source file