This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs
- From: Richard Biener <rguenther at suse dot de>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, jvdelisle at gcc dot gnu dot org, tkoenig at gcc dot gnu dot org, pault at gcc dot gnu dot org
- Date: Fri, 27 May 2016 11:19:46 +0200 (CEST)
- Subject: Re: [fortran] Re: Make array_at_struct_end_p to grok MEM_REFs
- Authentication-results: sourceware.org; auth=none
- References: <20160520131048 dot GA55871 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1605201528050 dot 18037 at t29 dot fhfr dot qr> <20160523163236 dot GA60007 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1605241002370 dot 18037 at t29 dot fhfr dot qr> <20160524102702 dot GB63338 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1605241232520 dot 18037 at t29 dot fhfr dot qr> <20160524122259 dot GC60007 at kam dot mff dot cuni dot cz> <20160524124749 dot GE60007 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1605241520440 dot 18037 at t29 dot fhfr dot qr> <20160524132605 dot GA61144 at kam dot mff dot cuni dot cz> <20160527075257 dot GA45202 at kam dot mff dot cuni dot cz>
On Fri, 27 May 2016, Jan Hubicka wrote:
> Hi,
> this is version of patch which bootstrap®ress 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)