From: Alexandre Oliva Date: Thu, 18 Dec 2003 04:24:06 +0000 (+0000) Subject: frv.c (frv_ifcvt_modify_insn): Don't leave alone scratch insns of the then branch... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5da1fd3dc2a76aede33fed347d9a6bdca4a378ed;p=gcc.git frv.c (frv_ifcvt_modify_insn): Don't leave alone scratch insns of the then branch that clobber regs needed by... * config/frv/frv.c (frv_ifcvt_modify_insn): Don't leave alone scratch insns of the then branch that clobber regs needed by the else branch. From-SVN: r74771 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ce2fa51b499..ba3bd9d4a7c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-12-17 Alexandre Oliva + + * config/frv/frv.c (frv_ifcvt_modify_insn): Don't leave alone + scratch insns of the then branch that clobber regs needed by the + else branch. + 2003-12-17 Kazu Hirata * calls.c (expand_call): Update comments. diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index 8d36bc61c45..6ee41847484 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -6942,7 +6942,7 @@ single_set_pattern (rtx pattern) insn cannot be converted to be executed conditionally. */ rtx -frv_ifcvt_modify_insn (ce_if_block_t *ce_info ATTRIBUTE_UNUSED, +frv_ifcvt_modify_insn (ce_if_block_t *ce_info, rtx pattern, rtx insn) { @@ -7068,7 +7068,16 @@ frv_ifcvt_modify_insn (ce_if_block_t *ce_info ATTRIBUTE_UNUSED, other registers. */ else if (frv_ifcvt.scratch_insns_bitmap && bitmap_bit_p (frv_ifcvt.scratch_insns_bitmap, - INSN_UID (insn))) + INSN_UID (insn)) + /* We must not unconditionally set a reg set used as + scratch in the THEN branch if the same reg is live + in the ELSE branch. */ + && REG_P (SET_DEST (set)) + && (! ce_info->else_bb + || BLOCK_FOR_INSN (insn) == ce_info->else_bb + || ! (REGNO_REG_SET_P + (ce_info->else_bb->global_live_at_start, + REGNO (SET_DEST (set)))))) pattern = set; else if (mode == QImode || mode == HImode || mode == SImode