------- Comment #5 from pault at gcc dot gnu dot org  2008-12-18 09:13 -------
I am most of the way onto a solution for this so I'll assign myself.

The source of the problem is highlighted by two tests:

s/call foo(func("_"//bar()))/call foo(func(bar()))/

works fine as does a modified testcase with integers instead of characters and
the concatenation replaced by another operation such as 1 + bar().

Thus the likely problem is the string length.  This is confirmed by setting it
to gfc_index_one_node in gfc_conv_expr_descriptor, whereupon the compilation
completes because it is now possible to calculate a (wrong!) size for the
temporary.

An elemental function argument works because this is explicitly taken care of
by get_elemental_fcn_charlen. When I wrote this function, I noted that this PR
was a possibility but could not see an easy way to deal with it.  The time has
come to do the difficult thing! We'll have to scan the expression and sum the
string lengths, calling get_elemental_fcn_charlen as necessary.  It is a happy
chance that there is only the concatenation operator:-)

It is increasingly my opinion that interface mapping should be done in
resolution, at the end of resolve_call and resolve_function, but that will have
to wait for gcc-4.6.

Paul

Cheers

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-12-16 15:35:45         |2008-12-18 09:13:47
               date|                            |


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

Reply via email to