Fortran FE getting frisky with types

Steve Kargl sgk@troutmask.apl.washington.edu
Fri May 27 00:48:00 GMT 2005


On Thu, May 26, 2005 at 05:11:01PM -0700, Richard Henderson wrote:
> On Thu, May 26, 2005 at 03:27:25PM -0700, Steve Kargl wrote:
> >           convert (TREE_TYPE (tmp), integer_zero_node));
> 
> build_int_cst (type, 0);
> 

Okay.  Here's a patch.  I bubblestrap and regression
tested this on amd64-*-freebsd.  Ok for mainline
(and 4.0 after a bootstrap and regression test)?

Diego, does this fix your problems with gfortran and VRP?

2005-05-26  Steven G. Kargl  <kargls@comcast.net>

	* trans-array.c (gfc_trans_deferred_array): Use build_int_cst to force
	like types in comparsion.

-- 
Steve
-------------- next part --------------
Index: trans-array.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/trans-array.c,v
retrieving revision 1.43
diff -c -p -r1.43 trans-array.c
*** trans-array.c	29 Apr 2005 15:31:38 -0000	1.43
--- trans-array.c	27 May 2005 00:44:11 -0000
*************** gfc_trans_deferred_array (gfc_symbol * s
*** 4000,4006 ****
        deallocate = gfc_array_deallocate (descriptor);
  
        tmp = gfc_conv_descriptor_data (descriptor);
!       tmp = build2 (NE_EXPR, boolean_type_node, tmp, integer_zero_node);
        tmp = build3_v (COND_EXPR, tmp, deallocate, build_empty_stmt ());
        gfc_add_expr_to_block (&block, tmp);
  
--- 4000,4007 ----
        deallocate = gfc_array_deallocate (descriptor);
  
        tmp = gfc_conv_descriptor_data (descriptor);
!       tmp = build2 (NE_EXPR, boolean_type_node, tmp, 
! 		    build_int_cst (TREE_TYPE (tmp), 0));
        tmp = build3_v (COND_EXPR, tmp, deallocate, build_empty_stmt ());
        gfc_add_expr_to_block (&block, tmp);
  


More information about the Fortran mailing list