This is another problem I found working on a new target. In fold-const,
when folding conversions, there are two instances where mode bitsizes
are compared to type precisions. This fails to do the right thing if
mode precision and bitsize differ (which I believe they currently don't
on any target).

Bootstrapped and regression tested on i686-linux. Ok?


Bernd
        * fold-const.c (fold_unary_loc): Use GET_MODE_PRECISION for
        comparisons against TYPE_PRECISION.
 
Index: gcc/fold-const.c
===================================================================
--- gcc/fold-const.c    (revision 365109)
+++ gcc/fold-const.c    (working copy)
@@ -8586,7 +8586,7 @@ fold_unary_loc (location_t loc, enum tre
              && 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))
@@ -8620,7 +8620,7 @@ fold_unary_loc (location_t loc, enum tre
                  == (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));
        }

Reply via email to