public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/47775] New: Error on allocatable array returned by function
@ 2011-02-16 23:48 fmartinez at gmv dot com
  2011-02-16 23:50 ` [Bug fortran/47775] " kargl at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: fmartinez at gmv dot com @ 2011-02-16 23:48 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Error on allocatable array returned by function
           Product: gcc
           Version: 4.5.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: fmartinez@gmv.com


Created attachment 23370
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23370
Modules, one program and a data file in XML

A function returning an allocatable array seems to have the return array
variable already allocated on entry to the function. The attempt to allocate it
generates the error:
Fortran runtime error: Attempting to allocate already allocated array 'res'

In module t_dom_node_slist_ftl.f90 the commented lines 1358 to 1361 solve the
problem but would expect that function return allocatable arrays are not
allocated on entry (this is the observed behaviour in Intel and g95)

The attached .tar.gz contains the collection of files that reproduce the
problem (sorry, but I have not been able to isolate the problem in a smaller
case).
The compilation command line I have used is:
> /opt/gfortran/bin/gfortran -g  m_string.F90 m_messages.f90 m_util_convert.f90 m_xml.f90 m_dom_element.f90 t_dom_element_pure_tree_ftl.f90 t_string_slist_ftl.f90 m_dom_node.f90 t_dom_node_slist_ftl.f90 m_dom_xpath.f90 m_dom.f90 m_unit_support.f90 unit_m_dom_xpath.f90

The resulting a.out has to be executed with the command line:

> ./ a.out 1

this uses the file unit_m_dom.xml as input

Cheers,

Fran


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-02-19 11:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-16 23:48 [Bug libfortran/47775] New: Error on allocatable array returned by function fmartinez at gmv dot com
2011-02-16 23:50 ` [Bug fortran/47775] " kargl at gcc dot gnu.org
2011-02-17  7:53 ` burnus at gcc dot gnu.org
2011-02-17  9:22 ` fmartinez at gmv dot com
2011-02-17 10:35 ` [Bug fortran/47775] Wrong code with allocatable function RESULT and GENERIC interfaces burnus at gcc dot gnu.org
2011-02-17 23:59 ` burnus at gcc dot gnu.org
2011-02-18  0:01 ` burnus at gcc dot gnu.org
2011-02-18 10:16 ` janus at gcc dot gnu.org
2011-02-18 11:41 ` pault at gcc dot gnu.org
2011-02-18 22:34 ` burnus at gcc dot gnu.org
2011-02-19 10:28 ` burnus at gcc dot gnu.org
2011-02-19 12:09 ` burnus at gcc dot gnu.org
2011-02-19 12:26 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).