This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[fortran, committed] Fix CTIME code generation
- From: FX <fxcoudert at gmail dot com>
- To: gfortran List <fortran at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 12 Mar 2011 11:28:29 +0100
- Subject: [fortran, committed] Fix CTIME code generation
The patch below fixes PR 47552, where we generate a variable of wrong type for the string length argument passed to CTIME. Patch was approved in the PR, was regtested on x86_64-linux. Committed as revision 170898.
2011-03-12 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/47552
* trans-intrinsic.c (gfc_conv_intrinsic_ctime): Fix type of
the string length variable.
Index: trans-intrinsic.c
===================================================================
--- trans-intrinsic.c (revision 170897)
+++ trans-intrinsic.c (working copy)
@@ -1501,7 +1501,7 @@ gfc_conv_intrinsic_ctime (gfc_se * se, g
args = XALLOCAVEC (tree, num_args);
var = gfc_create_var (pchar_type_node, "pstr");
- len = gfc_create_var (gfc_get_int_type (8), "len");
+ len = gfc_create_var (gfc_charlen_type_node, "len");
gfc_conv_intrinsic_function_args (se, expr, &args[2], num_args - 2);
args[0] = gfc_build_addr_expr (NULL_TREE, var);