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]

[PATCH][fortran] More type fixes


This fixes all testsuite problems with the gimple type verifier apart
from PR31608 (I'm lost on it).  Basically, more instances of binary
expressions with mixed int4 / int8 or signed / unsigned arguments.

Bootstrapped and tested on x86_64-unknown-linux-gnu.

Ok for mainline?

Thanks,
Richard.

2007-07-11  Richard Guenther  <rguenther@suse.de>

	* trans-intrinsic.c (gfc_conv_intrinsic_repeat): Convert
	arguments to gfc_charlen_type_node.
	* trans-io.c (gfc_convert_array_to_string): Convert type
	size to gfc_array_index_type.

Index: gcc/fortran/trans-intrinsic.c
===================================================================
*** gcc.orig/fortran/trans-intrinsic.c	2007-07-11 13:26:00.000000000 +0200
--- gcc/fortran/trans-intrinsic.c	2007-07-11 13:48:50.000000000 +0200
*************** gfc_conv_intrinsic_repeat (gfc_se * se, 
*** 3570,3576 ****
  			   &se->pre, &expr->where);
  
    /* Compute the destination length.  */
!   dlen = fold_build2 (MULT_EXPR, gfc_charlen_type_node, slen, ncopies);
    type = gfc_get_character_type (expr->ts.kind, expr->ts.cl);
    dest = gfc_conv_string_tmp (se, build_pointer_type (type), dlen);
  
--- 3570,3578 ----
  			   &se->pre, &expr->where);
  
    /* Compute the destination length.  */
!   dlen = fold_build2 (MULT_EXPR, gfc_charlen_type_node,
! 		      fold_convert (gfc_charlen_type_node, slen),
! 		      fold_convert (gfc_charlen_type_node, ncopies));
    type = gfc_get_character_type (expr->ts.kind, expr->ts.cl);
    dest = gfc_conv_string_tmp (se, build_pointer_type (type), dlen);
  
*************** gfc_conv_intrinsic_repeat (gfc_se * se, 
*** 3594,3600 ****
    gfc_add_expr_to_block (&body, tmp);
  
    /* Call memmove (dest + (i*slen), src, slen).  */
!   tmp = fold_build2 (MULT_EXPR, gfc_charlen_type_node, slen,
  		     fold_convert (gfc_charlen_type_node, count));
    tmp = fold_build2 (POINTER_PLUS_EXPR, pchar_type_node,
  		     fold_convert (pchar_type_node, dest),
--- 3596,3603 ----
    gfc_add_expr_to_block (&body, tmp);
  
    /* Call memmove (dest + (i*slen), src, slen).  */
!   tmp = fold_build2 (MULT_EXPR, gfc_charlen_type_node,
! 		     fold_convert (gfc_charlen_type_node, slen),
  		     fold_convert (gfc_charlen_type_node, count));
    tmp = fold_build2 (POINTER_PLUS_EXPR, pchar_type_node,
  		     fold_convert (pchar_type_node, dest),
Index: gcc/fortran/trans-io.c
===================================================================
*** gcc.orig/fortran/trans-io.c	2007-07-11 13:26:00.000000000 +0200
--- gcc/fortran/trans-io.c	2007-07-11 13:48:50.000000000 +0200
*************** gfc_convert_array_to_string (gfc_se * se
*** 623,629 ****
      }
  
    tmp = TYPE_SIZE_UNIT (gfc_get_element_type (type));
!   size = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp);
  
    se->string_length = fold_convert (gfc_charlen_type_node, size);
  }
--- 623,630 ----
      }
  
    tmp = TYPE_SIZE_UNIT (gfc_get_element_type (type));
!   size = fold_build2 (MULT_EXPR, gfc_array_index_type, size,
! 		      fold_convert (gfc_array_index_type, tmp));
  
    se->string_length = fold_convert (gfc_charlen_type_node, size);
  }


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