Commit 53f04688 by David Malcolm Committed by David Malcolm

try_split returns an rtx_insn

2014-08-21  David Malcolm  <dmalcolm@redhat.com>

	* rtl.h (try_split): Strengthen return type from rtx to rtx_insn *.

	* emit-rtl.c (try_split): Likewise, also for locals "before" and
	"after".  For now, don't strengthen param "trial", which requires
	adding checked casts when returning it.

From-SVN: r214260
parent f630fc6a
2014-08-21 David Malcolm <dmalcolm@redhat.com> 2014-08-21 David Malcolm <dmalcolm@redhat.com>
* rtl.h (try_split): Strengthen return type from rtx to rtx_insn *.
* emit-rtl.c (try_split): Likewise, also for locals "before" and
"after". For now, don't strengthen param "trial", which requires
adding checked casts when returning it.
2014-08-21 David Malcolm <dmalcolm@redhat.com>
* debug.h (struct gcc_debug_hooks): Strengthen param 1 of hook * debug.h (struct gcc_debug_hooks): Strengthen param 1 of hook
"label" from rtx to rtx_code_label *. Strengthen param 1 of "label" from rtx to rtx_code_label *. Strengthen param 1 of
"var_location" hook from rtx to rtx_insn *. "var_location" hook from rtx to rtx_insn *.
......
...@@ -3551,11 +3551,11 @@ mark_label_nuses (rtx x) ...@@ -3551,11 +3551,11 @@ mark_label_nuses (rtx x)
replacement insn depending on the value of LAST. Otherwise, it replacement insn depending on the value of LAST. Otherwise, it
returns TRIAL. If the insn to be returned can be split, it will be. */ returns TRIAL. If the insn to be returned can be split, it will be. */
rtx rtx_insn *
try_split (rtx pat, rtx trial, int last) try_split (rtx pat, rtx trial, int last)
{ {
rtx before = PREV_INSN (trial); rtx_insn *before = PREV_INSN (trial);
rtx after = NEXT_INSN (trial); rtx_insn *after = NEXT_INSN (trial);
int has_barrier = 0; int has_barrier = 0;
rtx note, seq, tem; rtx note, seq, tem;
int probability; int probability;
...@@ -3565,7 +3565,7 @@ try_split (rtx pat, rtx trial, int last) ...@@ -3565,7 +3565,7 @@ try_split (rtx pat, rtx trial, int last)
/* We're not good at redistributing frame information. */ /* We're not good at redistributing frame information. */
if (RTX_FRAME_RELATED_P (trial)) if (RTX_FRAME_RELATED_P (trial))
return trial; return as_a <rtx_insn *> (trial);
if (any_condjump_p (trial) if (any_condjump_p (trial)
&& (note = find_reg_note (trial, REG_BR_PROB, 0))) && (note = find_reg_note (trial, REG_BR_PROB, 0)))
...@@ -3585,7 +3585,7 @@ try_split (rtx pat, rtx trial, int last) ...@@ -3585,7 +3585,7 @@ try_split (rtx pat, rtx trial, int last)
} }
if (!seq) if (!seq)
return trial; return as_a <rtx_insn *> (trial);
/* Avoid infinite loop if any insn of the result matches /* Avoid infinite loop if any insn of the result matches
the original pattern. */ the original pattern. */
...@@ -3594,7 +3594,7 @@ try_split (rtx pat, rtx trial, int last) ...@@ -3594,7 +3594,7 @@ try_split (rtx pat, rtx trial, int last)
{ {
if (INSN_P (insn_last) if (INSN_P (insn_last)
&& rtx_equal_p (PATTERN (insn_last), pat)) && rtx_equal_p (PATTERN (insn_last), pat))
return trial; return as_a <rtx_insn *> (trial);
if (!NEXT_INSN (insn_last)) if (!NEXT_INSN (insn_last))
break; break;
insn_last = NEXT_INSN (insn_last); insn_last = NEXT_INSN (insn_last);
......
...@@ -2465,7 +2465,7 @@ extern rtx delete_related_insns (rtx); ...@@ -2465,7 +2465,7 @@ extern rtx delete_related_insns (rtx);
extern rtx *find_constant_term_loc (rtx *); extern rtx *find_constant_term_loc (rtx *);
/* In emit-rtl.c */ /* In emit-rtl.c */
extern rtx try_split (rtx, rtx, int); extern rtx_insn *try_split (rtx, rtx, int);
extern int split_branch_probability; extern int split_branch_probability;
/* In unknown file */ /* In unknown file */
......
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