[Bug fortran/47775] Wrong code with allocatable function RESULT and GENERIC interfaces

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Feb 17 10:35:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47775

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
            Summary|Error on allocatable array  |Wrong code with allocatable
                   |returned by function        |function RESULT and GENERIC
                   |                            |interfaces

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-02-17 10:23:21 UTC ---
Reduced test case: The crucial point is the GENERIC interface.

interface gen
  procedure foo
end interface gen

integer :: bar(2)
bar = gen()

contains
  function foo()
    integer, allocatable :: foo(:)
    allocate(foo(2))
  end function foo
end

 * * *

(In reply to comment #3)
> The problem reported on the string_to_char is correct in the sense that if
> invoked with a non allocated string it would cause a segfault.

Well, it did here - and the failure came before the failure you reported ...



More information about the Gcc-bugs mailing list