Bug in gfortran with ENTRY

Paul Richard Thomas paul.richard.thomas@gmail.com
Fri Sep 19 16:11:00 GMT 2008


Tobias and Arjen,

I have posted a patch which is not regtested but I believe to be OK.
It fixes the Internal Error and insists that the subroutine should be
recursive.

Cheers

Paul

On Fri, Sep 19, 2008 at 9:44 AM, Tobias Burnus <burnus@net-b.de> wrote:
> Hello Arjen,
>
> Arjen Markus wrote:
>> I found a bug in gfortran (version 4.3.0 20070816 experimental, to be
>> precise, on Linux) regarding the
>> following source code:
> [...]
>
> Thanks for the report. I confirmed it with 4.4 and filled a problem
> report (PR):
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37583
>
> Note: Your program is invalid as you recursively call the subprogram
> sub/glocal. NAG f95 and ifort detect this (gfortran doesn't). However,
> even if one adds a RECURSIVE, gfortran shows the same error. Thus you
> have found an accepts-invalid/diagnostic bug and an ICE-on-valid-code
> bug in one shot. (ICE = internal compiler error). Thank you!
>
>> This does not happen if the subroutine is outside a module. While the
>> ENTRY statement
>> has its own set of quirks, and the context in which I tried to use it
>> was non-standard (and
>> only a small experiment - I never use it otherwise), the compiler
>> should not produce an
>> internal error, IMHO.
>
> Internal errors are by definition always compiler errors, which should
> never happen.
>
> If you want to have special fun with ENTRY, try ENTRY with BIND(C) - and
> especially character(len=1,kindx=C_CHAR) returning functions. My
> personal guess is that almost? no compiler supports this correctly.
> (ENTRY with BIND(C) works in gfortran, but not yet for character
> returning functions; mixing BIND(C) with no BIND(C) in the same
> subprogram is also fun.)
>
> Tobias
>



-- 
The knack of flying is learning how to throw yourself at the ground and miss.
 --Hitchhikers Guide to the Galaxy



More information about the Fortran mailing list