Commit f7dbf8e5 by Martin Liska Committed by Martin Liska

Fix UBSAN in regrename.c (PR rtl-optimization/84635).

2018-03-18  Martin Liska  <mliska@suse.cz>

	PR rtl-optimization/84635
	* regrename.c (build_def_use): Use matches_mode only when
	matches >= 0.

From-SVN: r258634
parent 96c8b253
2018-03-18 Martin Liska <mliska@suse.cz>
PR rtl-optimization/84635
* regrename.c (build_def_use): Use matches_mode only when
matches >= 0.
2018-03-18 Richard Sandiford <richard.sandiford@linaro.org>
PR tree-optimization/84913
......
......@@ -1703,14 +1703,18 @@ build_def_use (basic_block bb)
and we must instead make sure to make the operand visible
to the machinery that tracks hard registers. */
machine_mode i_mode = recog_data.operand_mode[i];
machine_mode matches_mode = recog_data.operand_mode[matches];
if (matches >= 0
&& maybe_ne (GET_MODE_SIZE (i_mode),
GET_MODE_SIZE (matches_mode))
&& !verify_reg_in_set (op, &live_in_chains))
if (matches >= 0)
{
untracked_operands |= 1 << i;
untracked_operands |= 1 << matches;
machine_mode matches_mode
= recog_data.operand_mode[matches];
if (maybe_ne (GET_MODE_SIZE (i_mode),
GET_MODE_SIZE (matches_mode))
&& !verify_reg_in_set (op, &live_in_chains))
{
untracked_operands |= 1 << i;
untracked_operands |= 1 << matches;
}
}
}
#ifdef STACK_REGS
......
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