This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs


On Fri, 27 May 2016, Jan Hubicka wrote:

> Hi,
> this is version of patch which bootstrap&regress all languages at x86_64. OK?

The tree-pretty-print.c change is ok.  I think the

> -  if (stride)
> +  if (stride && akind >= GFC_ARRAY_ALLOCATABLE)

should include a comment.

Richard.

> Honza
> 
> 	* trans-types.c (gfc_array_range_type): Remove.
> 	(gfc_init_types): Do not build gfc_array_range_type.
> 	(gfc_get_array_type_bounds): Do not put unrealistic array bounds.
> 	* trans-types.h (gfc_array_range_type): Remove.
> 	* tree-pretty-print.c (dump_array_domain): Dump empty domain as
> 	[0:].
> Index: fortran/trans-types.c
> ===================================================================
> --- fortran/trans-types.c	(revision 236762)
> +++ fortran/trans-types.c	(working copy)
> @@ -52,7 +52,6 @@ along with GCC; see the file COPYING3.
>  CInteropKind_t c_interop_kinds_table[ISOCBINDING_NUMBER];
>  
>  tree gfc_array_index_type;
> -tree gfc_array_range_type;
>  tree gfc_character1_type_node;
>  tree pvoid_type_node;
>  tree prvoid_type_node;
> @@ -945,12 +944,6 @@ gfc_init_types (void)
>      = build_pointer_type (build_function_type_list (void_type_node, NULL_TREE));
>  
>    gfc_array_index_type = gfc_get_int_type (gfc_index_integer_kind);
> -  /* We cannot use gfc_index_zero_node in definition of gfc_array_range_type,
> -     since this function is called before gfc_init_constants.  */
> -  gfc_array_range_type
> -	  = build_range_type (gfc_array_index_type,
> -			      build_int_cst (gfc_array_index_type, 0),
> -			      NULL_TREE);
>  
>    /* The maximum array element size that can be handled is determined
>       by the number of bits available to store this field in the array
> @@ -1920,12 +1913,12 @@ gfc_get_array_type_bounds (tree etype, i
>  
>    /* We define data as an array with the correct size if possible.
>       Much better than doing pointer arithmetic.  */
> -  if (stride)
> +  if (stride && akind >= GFC_ARRAY_ALLOCATABLE)
>      rtype = build_range_type (gfc_array_index_type, gfc_index_zero_node,
>  			      int_const_binop (MINUS_EXPR, stride,
>  					       build_int_cst (TREE_TYPE (stride), 1)));
>    else
> -    rtype = gfc_array_range_type;
> +    rtype = NULL;
>    arraytype = build_array_type (etype, rtype);
>    arraytype = build_pointer_type (arraytype);
>    if (restricted)
> Index: fortran/trans-types.h
> ===================================================================
> --- fortran/trans-types.h	(revision 236762)
> +++ fortran/trans-types.h	(working copy)
> @@ -24,7 +24,6 @@ along with GCC; see the file COPYING3.
>  #define GFC_BACKEND_H
>  
>  extern GTY(()) tree gfc_array_index_type;
> -extern GTY(()) tree gfc_array_range_type;
>  extern GTY(()) tree gfc_character1_type_node;
>  extern GTY(()) tree ppvoid_type_node;
>  extern GTY(()) tree pvoid_type_node;
> Index: tree-pretty-print.c
> ===================================================================
> --- tree-pretty-print.c	(revision 236762)
> +++ tree-pretty-print.c	(working copy)
> @@ -362,7 +362,7 @@ dump_array_domain (pretty_printer *pp, t
>  	}
>      }
>    else
> -    pp_string (pp, "<unknown>");
> +    pp_string (pp, "0:");
>    pp_right_bracket (pp);
>  }
>  
> 
> 

-- 
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)


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