+2012-11-20 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * stor-layout.c (bit_field_mode_iterator::next_mode): Fix signedness.
+
2012-11-20 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/55396
if (unit != GET_MODE_PRECISION (mode_))
continue;
- /* Skip modes that are too small. */
- if ((bitpos_ % unit) + bitsize_ > unit)
- continue;
-
/* Stop if the mode is too wide to handle efficiently. */
if (unit > MAX_FIXED_MODE_SIZE)
break;
if (count_ > 0 && unit > BITS_PER_WORD)
break;
+ /* Skip modes that are too small. */
+ unsigned HOST_WIDE_INT substart = (unsigned HOST_WIDE_INT) bitpos_ % unit;
+ unsigned HOST_WIDE_INT subend = substart + bitsize_;
+ if (subend > unit)
+ continue;
+
/* Stop if the mode goes outside the bitregion. */
- HOST_WIDE_INT start = bitpos_ - (bitpos_ % unit);
+ HOST_WIDE_INT start = bitpos_ - substart;
if (bitregion_start_ && start < bitregion_start_)
break;
- if (start + unit > bitregion_end_ + 1)
+ HOST_WIDE_INT end = start + unit;
+ if (end > bitregion_end_ + 1)
break;
/* Stop if the mode requires too much alignment. */