+2013-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR other/59545
+ * genattrtab.c (struct attr_hash): Change hashcode type to unsigned.
+ (attr_hash_add_rtx, attr_hash_add_string): Change hashcode parameter
+ to unsigned.
+ (attr_rtx_1): Change hashcode variable to unsigned.
+ (attr_string): Likewise. Perform first multiplication in unsigned
+ type.
+ * ifcvt.c (noce_try_store_flag_constants): Avoid signed integer
+ overflows.
+ * double-int.c (neg_double): Likewise.
+ * stor-layout.c (set_min_and_max_values_for_integral_type): Likewise.
+ * combine.c (force_to_mode): Likewise.
+ * postreload.c (move2add_use_add2_insn, move2add_use_add3_insn,
+ reload_cse_move2add, move2add_note_store): Likewise.
+ * simplify-rtx.c (simplify_const_unary_operation,
+ simplify_const_binary_operation): Likewise.
+ * ipa-split.c (find_split_points): Initialize first.can_split
+ and first.non_ssa_vars.
+ * gengtype-state.c (read_state_files_list): Fix up check.
+ * genautomata.c (reserv_sets_hash_value): Use portable rotation
+ idiom.
+
2013-12-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/neon-docgen.ml: Add crypto intrinsics documentation.
/* If X is (minus C Y) where C's least set bit is larger than any bit
in the mask, then we may replace with (neg Y). */
if (CONST_INT_P (XEXP (x, 0))
- && (((unsigned HOST_WIDE_INT) (INTVAL (XEXP (x, 0))
- & -INTVAL (XEXP (x, 0))))
- > mask))
+ && ((UINTVAL (XEXP (x, 0)) & -UINTVAL (XEXP (x, 0))) > mask))
{
x = simplify_gen_unary (NEG, GET_MODE (x), XEXP (x, 1),
GET_MODE (x));
if (l1 == 0)
{
*lv = 0;
- *hv = - h1;
+ *hv = - (unsigned HOST_WIDE_INT) h1;
return (*hv & h1) < 0;
}
else
struct attr_hash
{
struct attr_hash *next; /* Next structure in the bucket. */
- int hashcode; /* Hash code of this rtx or string. */
+ unsigned int hashcode; /* Hash code of this rtx or string. */
union
{
char *str; /* The string (negative hash codes) */
/* Add an entry to the hash table for RTL with hash code HASHCODE. */
static void
-attr_hash_add_rtx (int hashcode, rtx rtl)
+attr_hash_add_rtx (unsigned int hashcode, rtx rtl)
{
struct attr_hash *h;
/* Add an entry to the hash table for STRING with hash code HASHCODE. */
static void
-attr_hash_add_string (int hashcode, char *str)
+attr_hash_add_string (unsigned int hashcode, char *str)
{
struct attr_hash *h;
attr_rtx_1 (enum rtx_code code, va_list p)
{
rtx rt_val = NULL_RTX;/* RTX to return to caller... */
- int hashcode;
+ unsigned int hashcode;
struct attr_hash *h;
struct obstack *old_obstack = rtl_obstack;
attr_string (const char *str, int len)
{
struct attr_hash *h;
- int hashcode;
+ unsigned int hashcode;
int i;
char *new_str;
/* Compute the hash code. */
- hashcode = (len + 1) * 613 + (unsigned) str[0];
+ hashcode = (len + 1) * 613U + (unsigned) str[0];
for (i = 1; i < len; i += 2)
hashcode = ((hashcode * 613) + (unsigned) str[i]);
- if (hashcode < 0)
+ if ((int) hashcode < 0)
hashcode = -hashcode;
/* Search the table for the string. */
{
reservs_num--;
hash_value += ((*reserv_ptr >> i)
- | (*reserv_ptr << (sizeof (set_el_t) * CHAR_BIT - i)));
+ | (*reserv_ptr << ((sizeof (set_el_t) * CHAR_BIT) & -i)));
i++;
if (i == sizeof (set_el_t) * CHAR_BIT)
i = 0;
"expecting file in !fileslist of state file");
};
t0 = peek_state_token (0);
- if (!state_token_kind (t0) == STOK_RIGHTPAR)
+ if (state_token_kind (t0) != STOK_RIGHTPAR)
fatal_reading_state (t0, "missing ) for !fileslist in state file");
next_state_tokens (1);
}
ifalse = INTVAL (if_info->a);
itrue = INTVAL (if_info->b);
+ diff = (unsigned HOST_WIDE_INT) itrue - ifalse;
/* Make sure we can represent the difference between the two values. */
- if ((itrue - ifalse > 0)
+ if ((diff > 0)
!= ((ifalse < 0) != (itrue < 0) ? ifalse < 0 : ifalse < itrue))
return FALSE;
- diff = trunc_int_for_mode (itrue - ifalse, mode);
+ diff = trunc_int_for_mode (diff, mode);
can_reverse = (reversed_comparison_code (if_info->cond, if_info->jump)
!= UNKNOWN);
if (reversep)
{
tmp = itrue; itrue = ifalse; ifalse = tmp;
- diff = trunc_int_for_mode (-diff, mode);
+ diff = trunc_int_for_mode (-(unsigned HOST_WIDE_INT) diff, mode);
}
start_sequence ();
first.earliest = INT_MAX;
first.set_ssa_names = 0;
first.used_ssa_names = 0;
+ first.non_ssa_vars = 0;
first.bbs_visited = 0;
+ first.can_split = false;
stack.safe_push (first);
ENTRY_BLOCK_PTR_FOR_FN (cfun)->aux = (void *)(intptr_t)-1;
+2013-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR other/59545
+ * class.c (hashUtf8String): Compute hash in unsigned type.
+ * javaop.h (WORD_TO_INT): Avoid signed integer overflow.
+
2013-11-22 Andrew MacLeod <amacleod@redhat.com>
* java-gimplify.c: Add required include files from gimple.h.
{
const unsigned char* ptr = (const unsigned char*) str;
const unsigned char *limit = ptr + len;
- int32 hash = 0;
+ uint32 hash = 0;
for (; ptr < limit;)
{
int ch = UTF8_GET (ptr, limit);
{
jint n = w & 0xffffffff; /* Mask lower 32 bits. */
n ^= (jint)1 << 31;
- n -= (jint)1 << 31; /* Sign extend lower 32 bits to upper. */
+ n -= (uint32)1 << 31; /* Sign extend lower 32 bits to upper. */
return n;
}
rtx pat = PATTERN (insn);
rtx src = SET_SRC (pat);
int regno = REGNO (reg);
- rtx new_src = gen_int_mode (INTVAL (off) - reg_offset[regno],
+ rtx new_src = gen_int_mode (UINTVAL (off) - reg_offset[regno],
GET_MODE (reg));
bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
bool changed = false;
&& reg_symbol_ref[i] != NULL_RTX
&& rtx_equal_p (sym, reg_symbol_ref[i]))
{
- rtx new_src = gen_int_mode (INTVAL (off) - reg_offset[i],
+ rtx new_src = gen_int_mode (UINTVAL (off) - reg_offset[i],
GET_MODE (reg));
/* (set (reg) (plus (reg) (const_int 0))) is not canonical;
use (set (reg) (reg)) instead.
tem = gen_rtx_REG (GET_MODE (reg), min_regno);
if (i != min_regno)
{
- rtx new_src = gen_int_mode (INTVAL (off) - reg_offset[min_regno],
+ rtx new_src = gen_int_mode (UINTVAL (off) - reg_offset[min_regno],
GET_MODE (reg));
tem = gen_rtx_PLUS (GET_MODE (reg), tem, new_src);
}
&& CONST_INT_P (XEXP (SET_SRC (set), 1)))
{
rtx src3 = XEXP (SET_SRC (set), 1);
- HOST_WIDE_INT added_offset = INTVAL (src3);
+ unsigned HOST_WIDE_INT added_offset = UINTVAL (src3);
HOST_WIDE_INT base_offset = reg_offset[REGNO (src)];
HOST_WIDE_INT regno_offset = reg_offset[regno];
rtx new_src =
{
rtx src = SET_SRC (set);
rtx base_reg;
- HOST_WIDE_INT offset;
+ unsigned HOST_WIDE_INT offset;
int base_regno;
switch (GET_CODE (src))
base_reg = XEXP (src, 0);
if (CONST_INT_P (XEXP (src, 1)))
- offset = INTVAL (XEXP (src, 1));
+ offset = UINTVAL (XEXP (src, 1));
else if (REG_P (XEXP (src, 1))
&& move2add_valid_value_p (REGNO (XEXP (src, 1)), mode))
{
break;
case NEG:
- val = - arg0;
+ val = - (unsigned HOST_WIDE_INT) arg0;
break;
case ABS:
switch (code)
{
case PLUS:
- val = arg0s + arg1s;
+ val = (unsigned HOST_WIDE_INT) arg0s + arg1s;
break;
case MINUS:
- val = arg0s - arg1s;
+ val = (unsigned HOST_WIDE_INT) arg0s - arg1s;
break;
case MULT:
- val = arg0s * arg1s;
+ val = (unsigned HOST_WIDE_INT) arg0s * arg1s;
break;
case DIV:
max_value
= build_int_cst_wide (type, precision - HOST_BITS_PER_WIDE_INT >= 0
? -1
- : ((HOST_WIDE_INT) 1 << precision) - 1,
+ : (HOST_WIDE_INT_1U << precision) - 1,
precision - HOST_BITS_PER_WIDE_INT > 0
? ((unsigned HOST_WIDE_INT) ~0
>> (HOST_BITS_PER_WIDE_INT
= build_int_cst_wide (type,
(precision - HOST_BITS_PER_WIDE_INT > 0
? 0
- : (HOST_WIDE_INT) (-1) << (precision - 1)),
+ : HOST_WIDE_INT_M1U << (precision - 1)),
(((HOST_WIDE_INT) (-1)
<< (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
? precision - HOST_BITS_PER_WIDE_INT - 1