len = ROUND_UP (pd.size, BITS_PER_UNIT) / BITS_PER_UNIT;
memset (this_buffer, 0, len);
}
- else
+ else if (pd.rhs_off >= 0)
{
len = native_encode_expr (pd.rhs, this_buffer, bufsize,
(MAX (0, -pd.offset)
return (void *)-1;
}
}
+ else /* negative pd.rhs_off indicates we want to chop off first bits */
+ {
+ if (-pd.rhs_off >= bufsize)
+ return (void *)-1;
+ len = native_encode_expr (pd.rhs,
+ this_buffer + -pd.rhs_off / BITS_PER_UNIT,
+ bufsize - -pd.rhs_off / BITS_PER_UNIT,
+ MAX (0, -pd.offset) / BITS_PER_UNIT);
+ if (len <= 0
+ || len < (ROUND_UP (pd.size, BITS_PER_UNIT) / BITS_PER_UNIT
+ - MAX (0, -pd.offset) / BITS_PER_UNIT))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "Failed to encode %u "
+ "partial definitions\n", ndefs);
+ return (void *)-1;
+ }
+ }
unsigned char *p = buffer;
HOST_WIDE_INT size = pd.size;
}
else if (fn == IFN_LEN_STORE)
{
- pd.rhs_off = 0;
pd.offset = offset2i;
pd.size = (tree_to_uhwi (len)
+ -tree_to_shwi (bias)) * BITS_PER_UNIT;
+ if (BYTES_BIG_ENDIAN)
+ pd.rhs_off = pd.size - tree_to_uhwi (TYPE_SIZE (vectype));
+ else
+ pd.rhs_off = 0;
if (ranges_known_overlap_p (offset, maxsize,
pd.offset, pd.size))
return data->push_partial_def (pd, set, set,