From: Oleg Endo Date: Mon, 14 Sep 2015 13:46:14 +0000 (+0000) Subject: re PR target/67061 (sh64-elf: internal compiler error: in sh_find_set_of_reg, at... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6ba5bb293414a4114a8147b3e7fd38169aacccd;p=gcc.git re PR target/67061 (sh64-elf: internal compiler error: in sh_find_set_of_reg, at config/sh/sh-protos.h:235) gcc/ PR target/67061 * config/sh/sh-protos.h (sh_find_set_of_reg): Simplfiy for-loop. Handle call insns. From-SVN: r227750 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index db2ba99a010..86888f96883 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-09-14 Oleg Endo + + PR target/67061 + * config/sh/sh-protos.h (sh_find_set_of_reg): Simplfiy for-loop. + Handle call insns. + 2015-09-14 Chung-Lin Tang * lto-wrapper.c (merge_and_complain): Add OPT_fdiagnostics_show_caret, diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h index 3e4211be4de..bb7003c18cd 100644 --- a/gcc/config/sh/sh-protos.h +++ b/gcc/config/sh/sh-protos.h @@ -192,18 +192,19 @@ sh_find_set_of_reg (rtx reg, rtx_insn* insn, F stepfunc, if (!REG_P (reg) || insn == NULL_RTX) return result; - rtx_insn* previnsn = insn; - - for (result.insn = stepfunc (insn); result.insn != NULL_RTX; - previnsn = result.insn, result.insn = stepfunc (result.insn)) + for (rtx_insn* i = stepfunc (insn); i != NULL_RTX; i = stepfunc (i)) { - if (BARRIER_P (result.insn)) + if (BARRIER_P (i)) break; - if (!NONJUMP_INSN_P (result.insn)) - continue; - if (reg_set_p (reg, result.insn)) + if (!INSN_P (i) || DEBUG_INSN_P (i)) + continue; + if (reg_set_p (reg, i)) { - result.set_rtx = set_of (reg, result.insn); + if (CALL_P (i)) + break; + + result.insn = i; + result.set_rtx = set_of (reg, i); if (result.set_rtx == NULL_RTX || GET_CODE (result.set_rtx) != SET) break; @@ -226,12 +227,6 @@ sh_find_set_of_reg (rtx reg, rtx_insn* insn, F stepfunc, } } - /* If the loop above stopped at the first insn in the list, - result.insn will be null. Use the insn from the previous iteration - in this case. */ - if (result.insn == NULL) - result.insn = previnsn; - if (result.set_src != NULL) gcc_assert (result.insn != NULL && result.set_rtx != NULL);