Commit 2de3d3c6 by Vladimir Makarov Committed by Vladimir Makarov

re PR sanitizer/82353 (runtime ubsan crash)

2017-10-16  Vladimir Makarov  <vmakarov@redhat.com>

	PR sanitizer/82353
	* lra.c (collect_non_operand_hard_regs): Don't ignore operator
	locations.
	* lra-lives.c (bb_killed_pseudos, bb_gen_pseudos): Move up.
	(make_hard_regno_born, make_hard_regno_dead): Update
	bb_killed_pseudos and bb_gen_pseudos for fixed regs.

From-SVN: r253796
parent 55015c10
2017-10-16 Vladimir Makarov <vmakarov@redhat.com>
PR sanitizer/82353
* lra.c (collect_non_operand_hard_regs): Don't ignore operator
locations.
* lra-lives.c (bb_killed_pseudos, bb_gen_pseudos): Move up.
(make_hard_regno_born, make_hard_regno_dead): Update
bb_killed_pseudos and bb_gen_pseudos for fixed regs.
2017-10-16 Jeff Law <law@redhat.com> 2017-10-16 Jeff Law <law@redhat.com>
* tree-ssa-dse.c (live_bytes_read): Fix thinko. * tree-ssa-dse.c (live_bytes_read): Fix thinko.
...@@ -220,6 +220,9 @@ lra_intersected_live_ranges_p (lra_live_range_t r1, lra_live_range_t r2) ...@@ -220,6 +220,9 @@ lra_intersected_live_ranges_p (lra_live_range_t r1, lra_live_range_t r2)
return false; return false;
} }
/* The corresponding bitmaps of BB currently being processed. */
static bitmap bb_killed_pseudos, bb_gen_pseudos;
/* The function processing birth of hard register REGNO. It updates /* The function processing birth of hard register REGNO. It updates
living hard regs, START_LIVING, and conflict hard regs for living living hard regs, START_LIVING, and conflict hard regs for living
pseudos. Conflict hard regs for the pic pseudo is not updated if pseudos. Conflict hard regs for the pic pseudo is not updated if
...@@ -243,6 +246,8 @@ make_hard_regno_born (int regno, bool check_pic_pseudo_p ATTRIBUTE_UNUSED) ...@@ -243,6 +246,8 @@ make_hard_regno_born (int regno, bool check_pic_pseudo_p ATTRIBUTE_UNUSED)
|| i != REGNO (pic_offset_table_rtx)) || i != REGNO (pic_offset_table_rtx))
#endif #endif
SET_HARD_REG_BIT (lra_reg_info[i].conflict_hard_regs, regno); SET_HARD_REG_BIT (lra_reg_info[i].conflict_hard_regs, regno);
if (fixed_regs[regno])
bitmap_set_bit (bb_gen_pseudos, regno);
} }
/* Process the death of hard register REGNO. This updates /* Process the death of hard register REGNO. This updates
...@@ -255,6 +260,11 @@ make_hard_regno_dead (int regno) ...@@ -255,6 +260,11 @@ make_hard_regno_dead (int regno)
return; return;
sparseset_set_bit (start_dying, regno); sparseset_set_bit (start_dying, regno);
CLEAR_HARD_REG_BIT (hard_regs_live, regno); CLEAR_HARD_REG_BIT (hard_regs_live, regno);
if (fixed_regs[regno])
{
bitmap_clear_bit (bb_gen_pseudos, regno);
bitmap_set_bit (bb_killed_pseudos, regno);
}
} }
/* Mark pseudo REGNO as living at program point POINT, update conflicting /* Mark pseudo REGNO as living at program point POINT, update conflicting
...@@ -299,9 +309,6 @@ mark_pseudo_dead (int regno, int point) ...@@ -299,9 +309,6 @@ mark_pseudo_dead (int regno, int point)
} }
} }
/* The corresponding bitmaps of BB currently being processed. */
static bitmap bb_killed_pseudos, bb_gen_pseudos;
/* Mark register REGNO (pseudo or hard register) in MODE as live at /* Mark register REGNO (pseudo or hard register) in MODE as live at
program point POINT. Update BB_GEN_PSEUDOS. program point POINT. Update BB_GEN_PSEUDOS.
Return TRUE if the liveness tracking sets were modified, or FALSE Return TRUE if the liveness tracking sets were modified, or FALSE
......
...@@ -820,7 +820,8 @@ collect_non_operand_hard_regs (rtx *x, lra_insn_recog_data_t data, ...@@ -820,7 +820,8 @@ collect_non_operand_hard_regs (rtx *x, lra_insn_recog_data_t data,
const char *fmt = GET_RTX_FORMAT (code); const char *fmt = GET_RTX_FORMAT (code);
for (i = 0; i < data->insn_static_data->n_operands; i++) for (i = 0; i < data->insn_static_data->n_operands; i++)
if (x == data->operand_loc[i]) if (! data->insn_static_data->operand[i].is_operator
&& x == data->operand_loc[i])
/* It is an operand loc. Stop here. */ /* It is an operand loc. Stop here. */
return list; return list;
for (i = 0; i < data->insn_static_data->n_dups; i++) for (i = 0; i < data->insn_static_data->n_dups; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment