From: Adam Nemet Date: Sat, 18 Jul 2009 21:48:19 +0000 (+0000) Subject: combine.c (try_widen_shift_mode): Allow widening if the high-order bits are zero. X-Git-Tag: releases/gcc-4.5.0~4514 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e63dd3a366d314071d1568917c5a9887d113d68;p=thirdparty%2Fgcc.git combine.c (try_widen_shift_mode): Allow widening if the high-order bits are zero. * combine.c (try_widen_shift_mode) : Allow widening if the high-order bits are zero. From-SVN: r149779 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 96430050d90b..1c418d1a04b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-07-18 Adam Nemet + + * combine.c (try_widen_shift_mode) : Allow widening if the + high-order bits are zero. + 2009-07-18 Adam Nemet * combine.c (simplify_shift_const_1): Split code to determine diff --git a/gcc/combine.c b/gcc/combine.c index a0157df71406..12f0ed8223f1 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -9005,8 +9005,15 @@ try_widen_shift_mode (enum rtx_code code, rtx op, > (unsigned) (GET_MODE_BITSIZE (mode) - GET_MODE_BITSIZE (orig_mode))) return mode; - /* fall through */ + return orig_mode; + case LSHIFTRT: + /* Similarly here but with zero bits. */ + if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT + && (nonzero_bits (op, mode) & ~GET_MODE_MASK (orig_mode)) == 0) + return mode; + /* fall through */ + case ROTATE: return orig_mode;