This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Eliminate signed sizetypes (3/3)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 18 Apr 2010 19:38:17 +0200
- Subject: Re: [patch] Eliminate signed sizetypes (3/3)
- References: <201004181347.24127.ebotcazou@adacore.com>
On Sun, Apr 18, 2010 at 1:47 PM, Eric Botcazou <ebotcazou@adacore.com> wrote:
> This finally eliminates signed sizetypes, in the sense that front-ends must
> now pass an unsigned type to set_sizetype. ?The middle-end then derives a
> proper signed variant of this unsigned sizetype. ?This also fixes incorrect
> uses of size_type_node in lieu of sizetype (and one the other way around).
>
> Tested on x86_64-suse-linux, OK for the mainline?
- x = fold_build2_loc (loc, MULT_EXPR, size_type_node,
- fold_convert_loc (loc, size_type_node, nb_iter),
- fold_convert_loc (loc, size_type_node,
- TYPE_SIZE_UNIT (TREE_TYPE (op))));
+ tree x = size_binop (MULT_EXPR, fold_convert_loc (loc, sizetype, nb_iter),
+ TYPE_SIZE_UNIT (TREE_TYPE (op)));
can you keep using fold_build2_loc for getting a correct location?
Otherwise the patch is ok - the various frontend bits are obvious.
Many thanks for cleaning this up!
Richard.
> 2010-04-18 ?Eric Botcazou ?<ebotcazou@adacore.com>
>
> ? ? ? ?* fold-const.c (fold_comparison): Use ssizetype.
> ? ? ? ?* gimple-fold.c (maybe_fold_offset_to_array_ref): Likewise.
> ? ? ? ?* ipa-prop.c (ipa_modify_call_arguments): Use sizetype.
> ? ? ? ?* tree-loop-distribution.c (build_size_arg_loc): Likewise.
> ? ? ? ?* tree-object-size.c (compute_object_sizes): Use size_type_node.
>
> ? ? ? ?* tree.h (initialize_sizetypes): Remove parameter.
> ? ? ? ?(build_common_tree_nodes): Remove second parameter.
> ? ? ? ?* stor-layout.c (initialize_sizetypes): Remove parameter.
> ? ? ? ?Always create an unsigned type.
> ? ? ? ?(set_sizetype): Assert that the passed type is unsigned and simplify.
> ? ? ? ?* tree.c (build_common_tree_nodes): Remove second parameter.
> ? ? ? ?Adjust call to initialize_sizetypes.
> ? ? ? ?* c-decl.c (c_init_decl_processing): Remove second argument in call to
> ? ? ? ?build_common_tree_nodes.
> cp/
> ? ? ? ?* decl.c (cxx_init_decl_processing): Remove second argument in call to
> ? ? ? ?build_common_tree_nodes.
>
> java/
> ? ? ? ?* decl.c (java_init_decl_processing): Remove argument in call to
> ? ? ? ?initialize_sizetypes
>
> fortran/
> ? ? ? ?* f95-lang.c (gfc_init_decl_processing): Remove second argument in call
> ? ? ? ?to build_common_tree_nodes.
>
> ada/
> ? ? ? ?* gcc-interface/misc.c (gnat_init): Remove second argument in call to
> ? ? ? ?build_common_tree_nodes.
>
> lto/
> ? ? ? ?* lto-lang.c (lto_init): Remove second argument in call to
> ? ? ? ?build_common_tree_nodes.
>
>
> --
> Eric Botcazou
>