[PATCH 2/2] Enable elimination of zext/sext
Jakub Jelinek
jakub@redhat.com
Tue Jun 24 12:21:00 GMT 2014
On Tue, Jun 24, 2014 at 09:53:35PM +1000, Kugan wrote:
> 2014-06-24 Kugan Vivekanandarajah <kuganv@linaro.org>
>
> * gcc/calls.c (precompute_arguments: Check is_promoted_for_type
> and set the promoted mode.
> (is_promoted_for_type) : New function.
> (expand_expr_real_1) : Check is_promoted_for_type
> and set the promoted mode.
> * gcc/expr.h (is_promoted_for_type) : New function definition.
> * gcc/cfgexpand.c (expand_gimple_stmt_1) : Call emit_move_insn if
> SUBREG is promoted with SRP_SIGNED_AND_UNSIGNED.
Similarly to the other patch, no gcc/ prefix in ChangeLog, no space before
:, watch for too long lines, remove useless ()s around conditions.
> +bool
> +is_promoted_for_type (tree ssa, enum machine_mode lhs_mode, bool lhs_uns)
> +{
> + wide_int type_min, type_max;
> + wide_int min, max, limit;
> + unsigned int prec;
> + tree lhs_type;
> + bool rhs_uns;
> +
> + if (flag_wrapv
Why?
> + || (flag_strict_overflow == false)
Why? Also, that would be !flag_strict_overflow instead of
(flag_strict_overflow == false)
> + || (ssa == NULL_TREE)
> + || (TREE_CODE (ssa) != SSA_NAME)
> + || !INTEGRAL_TYPE_P (TREE_TYPE (ssa))
> + || POINTER_TYPE_P (TREE_TYPE (ssa)))
All pointer types are !INTEGRAL_TYPE_P, so the last condition
doesn't make any sense.
Jakub
More information about the Gcc-patches
mailing list