This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] Fix CHAR intrinsic.


Patch below fixes the CHAR & ACHAR intrinsics (with testcase).

Applied to tree-ssa branch.

Paul

2003-10-11  Huang Chun  <jiwang@mail.edu.cn>

	* trans-intrinsic.c (gfc_conv_intrinsic_char): Don't use
	gfc_get_character_type.

2003-10-11  Paul Brook  <paul@nowt.org>

	* gfortran.fortran-torture/execute/intrinsic_achar.f90: New test.

--- clean/tree-ssa/gcc/fortran/trans-intrinsic.c
+++ gcc/gcc/fortran/trans-intrinsic.c
@@ -898,12 +898,11 @@ gfc_conv_intrinsic_char (gfc_se * se, gf
 
   /* We currently don't support character types != 1.  */
   assert (expr->ts.kind == 1);
-  type = gfc_get_character_type (expr->ts.kind, expr->ts.cl);
+  type = gfc_character1_type_node;
   var = gfc_create_var (type, "char");
   TREE_ADDRESSABLE (var) = 1;
 
-  arg = convert (gfc_character1_type_node, arg);
-  var = build (ARRAY_REF, gfc_character1_type_node, var, integer_one_node);
+  arg = convert (type, arg);
   gfc_add_modify_expr (&se->pre, var, arg);
   se->expr = build1 (ADDR_EXPR, build_pointer_type (type), var);
   se->string_length = integer_one_node;

Attachment: intrinsic_achar.f90
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]