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: [PATCH] Add bult_int_cst_wide_type, use build_int_cst_type more


On 1/8/07, Richard Guenther <richard.guenther@gmail.com> wrote:
This patch removes all of the

   mask = build_int_cst (unsigned_type, -1);
   mask = force_fit_type (mask, 0, false, false);

idiom uses by either using the existing build_int_cst_type or the new
build_int_cst_wide_type.  This saves a tree node and a line of source.

Bootstrapped and tested on i686-pc-linux-gnu, another one including
all languages still running.

Bootstrapped also on x86_64-unknown-linux-gnu including ada which missed

* trans.c (gnat_to_gnu): Likewise.

applied to mainline.

Richard.

2007-01-08 Richard Guenther <rguenther@suse.de>

        * tree.h (build_int_cst_wide_type): Export.
        * tree.c (build_int_cst_wide_type): New function.
        (build_int_cst_wide): Fix comment.
        * builtins.c (fold_builtin_object_size): Use build_int_cst
        to build -1 or 0 of the correct type.  Use fit_double_type
        to check for overflow.
        * fold-const.c (optimize_bit_field_compare): Use build_int_cst_type
        to build the mask.
        (decode_field_reference): Likewise.
        (all_ones_mask_p): Likewise.
        (native_interpret_int): Use build_int_cst_wide_type.
        (fold_binary): Use build_int_cst_type to build an all-ones
        value.
        * stor-layout.c (set_sizetype): Use build_int_cst_wide_type.

        java/
        * lex.c (do_java_lex): Use build_int_cst_wide_type.
        * jcf-parse.c (get_constant): Likewise.

        cp/
        * cvt.c (cp_convert_to_pointer): Use build_int_cst_type.

        ada/
        * cuintp.c (build_cst_from_int): Use built_int_cst_type.





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