+2015-09-14 Marek Polacek <polacek@redhat.com>
+
+ * rtlanal.c (split_double): Cast to unsigned when shifting a negative
+ value.
+ * sched-int.h (UNKNOWN_DEP_COST): Likewise.
+
2015-09-11 Mark Wielaard <mjw@redhat.com>
PR c/28901
+2015-09-14 Marek Polacek <polacek@redhat.com>
+
+ * c-common.c (warn_for_sign_compare): Cast to unsigned when shifting
+ a negative value.
+
2015-09-11 Mark Wielaard <mjw@redhat.com>
PR c/28901
if (bits < TYPE_PRECISION (result_type)
&& bits < HOST_BITS_PER_LONG && unsignedp)
{
- mask = (~ (HOST_WIDE_INT) 0) << bits;
+ mask = (~ (unsigned HOST_WIDE_INT) 0) << bits;
if ((mask & constant) != mask)
{
if (constant == 0)
+2015-09-14 Marek Polacek <polacek@redhat.com>
+
+ * c-typeck.c (set_nonincremental_init_from_string): Use
+ HOST_WIDE_INT_M1U when shifting a negative value.
+
2015-09-09 Mark Wielaard <mjw@redhat.com>
* c-typeck.c (build_binary_op): Check and warn when nonnull arg
{
if (val[0] & (((HOST_WIDE_INT) 1) << (bitpos - 1)))
{
- val[0] |= ((HOST_WIDE_INT) -1) << bitpos;
+ val[0] |= HOST_WIDE_INT_M1U << bitpos;
val[1] = -1;
}
}
}
else if (val[1] & (((HOST_WIDE_INT) 1)
<< (bitpos - 1 - HOST_BITS_PER_WIDE_INT)))
- val[1] |= ((HOST_WIDE_INT) -1)
- << (bitpos - HOST_BITS_PER_WIDE_INT);
+ val[1] |= HOST_WIDE_INT_M1U << (bitpos - HOST_BITS_PER_WIDE_INT);
}
value = wide_int_to_tree (type,
if (BITS_PER_WORD < HOST_BITS_PER_LONG && BITS_PER_WORD == 32)
{
if (l[0] & ((long) 1 << 31))
- l[0] |= ((long) (-1) << 32);
+ l[0] |= ((unsigned long) (-1) << 32);
if (l[1] & ((long) 1 << 31))
- l[1] |= ((long) (-1) << 32);
+ l[1] |= ((unsigned long) (-1) << 32);
}
#endif
int cost:20;
};
-#define UNKNOWN_DEP_COST (-1<<19)
+#define UNKNOWN_DEP_COST ((int) ((unsigned int) -1 << 19))
typedef struct _dep dep_def;
typedef dep_def *dep_t;