return ret;
}
+/* Shift A right by COUNT places. */
+
+double_int
+double_int::rshift (HOST_WIDE_INT count) const
+{
+ double_int ret;
+
+ gcc_checking_assert (count >= 0);
+
+ if (count >= HOST_BITS_PER_DOUBLE_INT)
+ {
+ /* Shifting by the host word size is undefined according to the
+ ANSI standard, so we must handle this as a special case. */
+ ret.high = 0;
+ ret.low = 0;
+ }
+ else if (count >= HOST_BITS_PER_WIDE_INT)
+ {
+ ret.high = 0;
+ ret.low
+ = (unsigned HOST_WIDE_INT) (high >> (count - HOST_BITS_PER_WIDE_INT));
+ }
+ else
+ {
+ ret.high = high >> count;
+ ret.low = ((low >> count)
+ | ((unsigned HOST_WIDE_INT) high
+ << (HOST_BITS_PER_WIDE_INT - count - 1) << 1));
+ }
+
+ return ret;
+}
+
/* Shift A left by COUNT places keeping only PREC bits of result. Shift
right if COUNT is negative. ARITH true specifies arithmetic shifting;
otherwise use logical shift. */
double_int lshift (HOST_WIDE_INT count) const;
double_int lshift (HOST_WIDE_INT count, unsigned int prec, bool arith) const;
+ double_int rshift (HOST_WIDE_INT count) const;
double_int rshift (HOST_WIDE_INT count, unsigned int prec, bool arith) const;
double_int alshift (HOST_WIDE_INT count, unsigned int prec) const;
double_int arshift (HOST_WIDE_INT count, unsigned int prec) const;
{
vn_reference_op_s temp;
+ result->reserve (3);
+
memset (&temp, 0, sizeof (temp));
temp.type = TREE_TYPE (ref);
temp.opcode = TREE_CODE (ref);
temp.op1 = TMR_STEP (ref);
temp.op2 = TMR_OFFSET (ref);
temp.off = -1;
- result->safe_push (temp);
+ result->quick_push (temp);
memset (&temp, 0, sizeof (temp));
temp.type = NULL_TREE;
temp.opcode = ERROR_MARK;
temp.op0 = TMR_INDEX2 (ref);
temp.off = -1;
- result->safe_push (temp);
+ result->quick_push (temp);
memset (&temp, 0, sizeof (temp));
temp.type = NULL_TREE;
temp.opcode = TREE_CODE (TMR_BASE (ref));
temp.op0 = TMR_BASE (ref);
temp.off = -1;
- result->safe_push (temp);
+ result->quick_push (temp);
return;
}
double_int off
= tree_to_double_int (this_offset)
+ tree_to_double_int (bit_offset)
- .arshift (BITS_PER_UNIT == 8
- ? 3 : exact_log2 (BITS_PER_UNIT),
- HOST_BITS_PER_DOUBLE_INT);
+ .rshift (BITS_PER_UNIT == 8
+ ? 3 : exact_log2 (BITS_PER_UNIT));
if (off.fits_shwi ())
temp.off = off.low;
}
temp.off = 0;
result->safe_push (temp);
temp.opcode = ADDR_EXPR;
- temp.op0 = build_fold_addr_expr (ref);
+ temp.op0 = build1 (ADDR_EXPR, TREE_TYPE (temp.op0), ref);
temp.type = TREE_TYPE (temp.op0);
temp.off = -1;
break;
}
}
-/* Create a vector of vn_reference_op_s structures from REF, a
- REFERENCE_CLASS_P tree. The vector is not shared. */
-
-static vec<vn_reference_op_s>
-create_reference_ops_from_ref (tree ref)
-{
- vec<vn_reference_op_s> result = vNULL;
-
- copy_reference_ops_from_ref (ref, &result);
- return result;
-}
-
/* Create a vector of vn_reference_op_s structures from CALL, a
call statement. The vector is not shared. */
{
vn_reference_s **slot;
vn_reference_t vr1;
+ bool tem;
vr1 = (vn_reference_t) pool_alloc (current_info->references_pool);
if (TREE_CODE (result) == SSA_NAME)
else
vr1->value_id = get_or_alloc_constant_value_id (result);
vr1->vuse = vuse ? SSA_VAL (vuse) : NULL_TREE;
- vr1->operands = valueize_refs (create_reference_ops_from_ref (op));
+ vr1->operands = valueize_shared_reference_ops_from_ref (op, &tem).copy ();
vr1->type = TREE_TYPE (op);
vr1->set = get_alias_set (op);
vr1->hashcode = vn_reference_compute_hash (vr1);