OSDN Git Service

2008-01-18 Richard Sandiford <rsandifo@nildram.co.uk>
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Jan 2008 00:28:28 +0000 (00:28 +0000)
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Jan 2008 00:28:28 +0000 (00:28 +0000)
       PR fortran/34686
       * trans-expr.c (gfc_conv_function_call): Use proper
       type for returned character pointers.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131620 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c

index dccfcdf..ff0e639 100644 (file)
@@ -1,3 +1,9 @@
+2008-01-18  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       PR fortran/34686
+       * trans-expr.c (gfc_conv_function_call): Use proper
+       type for returned character pointers.
+
 2008-01-17  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/34429
index c1de2a9..9e30a99 100644 (file)
@@ -2660,13 +2660,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
             character pointers.  */
          if (sym->attr.pointer || sym->attr.allocatable)
            {
-             /* Build char[0:len-1] * pstr.  */
-             tmp = fold_build2 (MINUS_EXPR, gfc_charlen_type_node, len,
-                                build_int_cst (gfc_charlen_type_node, 1));
-             tmp = build_range_type (gfc_array_index_type,
-                                     gfc_index_zero_node, tmp);
-             tmp = build_array_type (gfc_character1_type_node, tmp);
-             var = gfc_create_var (build_pointer_type (tmp), "pstr");
+             var = gfc_create_var (type, "pstr");
 
              /* Provide an address expression for the function arguments.  */
              var = build_fold_addr_expr (var);