From: David Malcolm Date: Thu, 21 Aug 2014 08:53:25 +0000 (+0000) Subject: try_split returns an rtx_insn X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=53f04688052e6367be2d4294f792c1d35917746f;p=gcc.git try_split returns an rtx_insn 2014-08-21 David Malcolm * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d7b5b1846a2..518d86f3eab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2014-08-21 David Malcolm + + * 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 * debug.h (struct gcc_debug_hooks): Strengthen param 1 of hook diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 0ca59adc4ae..2d7d8540959 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3551,11 +3551,11 @@ mark_label_nuses (rtx x) replacement insn depending on the value of LAST. Otherwise, it 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) { - rtx before = PREV_INSN (trial); - rtx after = NEXT_INSN (trial); + rtx_insn *before = PREV_INSN (trial); + rtx_insn *after = NEXT_INSN (trial); int has_barrier = 0; rtx note, seq, tem; int probability; @@ -3565,7 +3565,7 @@ try_split (rtx pat, rtx trial, int last) /* We're not good at redistributing frame information. */ if (RTX_FRAME_RELATED_P (trial)) - return trial; + return as_a (trial); if (any_condjump_p (trial) && (note = find_reg_note (trial, REG_BR_PROB, 0))) @@ -3585,7 +3585,7 @@ try_split (rtx pat, rtx trial, int last) } if (!seq) - return trial; + return as_a (trial); /* Avoid infinite loop if any insn of the result matches the original pattern. */ @@ -3594,7 +3594,7 @@ try_split (rtx pat, rtx trial, int last) { if (INSN_P (insn_last) && rtx_equal_p (PATTERN (insn_last), pat)) - return trial; + return as_a (trial); if (!NEXT_INSN (insn_last)) break; insn_last = NEXT_INSN (insn_last); diff --git a/gcc/rtl.h b/gcc/rtl.h index 99d2d64190d..f9713f1fcbc 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -2465,7 +2465,7 @@ extern rtx delete_related_insns (rtx); extern rtx *find_constant_term_loc (rtx *); /* In emit-rtl.c */ -extern rtx try_split (rtx, rtx, int); +extern rtx_insn *try_split (rtx, rtx, int); extern int split_branch_probability; /* In unknown file */