[patch] Eliminate signed sizetypes (3/3)

Richard Guenther richard.guenther@gmail.com
Sun Apr 18 17:38:00 GMT 2010


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
>



More information about the Gcc-patches mailing list