gi->group_kill = BITMAP_ALLOC (&dse_bitmap_obstack);
gi->process_globally = false;
gi->frame_related =
- (base == frame_pointer_rtx) || (base == hard_frame_pointer_rtx);
+ (base == frame_pointer_rtx) || (base == hard_frame_pointer_rtx)
+ || (base == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM]);
gi->offset_map_size_n = 0;
gi->offset_map_size_p = 0;
gi->offset_map_n = NULL;
be active. */
static void
-check_mem_read_rtx (rtx *loc, bb_info_t bb_info)
+check_mem_read_rtx (rtx *loc, bb_info_t bb_info, bool used_in_call = false)
{
rtx mem = *loc, mem_addr;
insn_info_t insn_info;
stored, rewrite the read. */
else
{
- if (store_info->rhs
+ if (!used_in_call
+ && store_info->rhs
&& known_subrange_p (offset, width, store_info->offset,
store_info->width)
&& all_positions_needed_p (store_info,
/* If this read is just reading back something that we just
stored, rewrite the read. */
- if (store_info->rhs
+ if (!used_in_call
+ && store_info->rhs
&& store_info->group_id == -1
&& store_info->cse_base == base
&& known_subrange_p (offset, width, store_info->offset,
that is not relative to the frame. */
add_non_frame_wild_read (bb_info);
+ for (rtx link = CALL_INSN_FUNCTION_USAGE (insn);
+ link != NULL_RTX;
+ link = XEXP (link, 1))
+ if (GET_CODE (XEXP (link, 0)) == USE && MEM_P (XEXP (XEXP (link, 0),0)))
+ check_mem_read_rtx (&XEXP (XEXP (link, 0),0), bb_info, true);
+
return;
}