From: Bernd Schmidt Date: Wed, 11 Apr 2012 18:07:39 +0000 (+0000) Subject: fold-const.c (fold_unary_loc): Use GET_MODE_PRECISION for comparisons against TYPE_PR... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d3ea1dbdb267abe428d444f586af1fc724556898;p=gcc.git fold-const.c (fold_unary_loc): Use GET_MODE_PRECISION for comparisons against TYPE_PRECISION. * fold-const.c (fold_unary_loc): Use GET_MODE_PRECISION for comparisons against TYPE_PRECISION. * tree-ssa-forwprop.c (combine_conversions): Likewise. From-SVN: r186350 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b7ed7b1b476..9ea90db7e62 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-04-11 Bernd Schmidt + + * fold-const.c (fold_unary_loc): Use GET_MODE_PRECISION for + comparisons against TYPE_PRECISION. + * tree-ssa-forwprop.c (combine_conversions): Likewise. + 2012-04-11 Xinliang David Li * tree-passes.h: Remove TODO_dump_func. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index df0c05c6e02..dcd64a08a1b 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -7820,7 +7820,7 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0) && inter_prec >= inside_prec && (inter_float || inter_vec || inter_unsignedp == inside_unsignedp) - && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (type)) + && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type)) && TYPE_MODE (type) == TYPE_MODE (inter_type)) && ! final_ptr && (! final_vec || inter_prec == inside_prec)) @@ -7857,7 +7857,7 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0) == (final_unsignedp && final_prec > inter_prec)) && ! (inside_ptr && inter_prec != final_prec) && ! (final_ptr && inside_prec != inter_prec) - && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (type)) + && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type)) && TYPE_MODE (type) == TYPE_MODE (inter_type))) return fold_build1_loc (loc, code, type, TREE_OPERAND (op0, 0)); } diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c index c99af1a8c43..57b93cee7f1 100644 --- a/gcc/tree-ssa-forwprop.c +++ b/gcc/tree-ssa-forwprop.c @@ -1,5 +1,5 @@ /* Forward propagation of expressions for single use variables. - Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011 + Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -2274,7 +2274,7 @@ combine_conversions (gimple_stmt_iterator *gsi) && inter_prec >= inside_prec && (inter_float || inter_vec || inter_unsignedp == inside_unsignedp) - && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (type)) + && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type)) && TYPE_MODE (type) == TYPE_MODE (inter_type)) && ! final_ptr && (! final_vec || inter_prec == inside_prec)) @@ -2319,7 +2319,7 @@ combine_conversions (gimple_stmt_iterator *gsi) == (final_unsignedp && final_prec > inter_prec)) && ! (inside_ptr && inter_prec != final_prec) && ! (final_ptr && inside_prec != inter_prec) - && ! (final_prec != GET_MODE_BITSIZE (TYPE_MODE (type)) + && ! (final_prec != GET_MODE_PRECISION (TYPE_MODE (type)) && TYPE_MODE (type) == TYPE_MODE (inter_type))) { gimple_assign_set_rhs1 (stmt, defop0);