summaryrefslogtreecommitdiff
path: root/gcc/config/frv
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2004-11-26 18:53:47 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2004-11-26 18:53:47 +0000
commit9a228f097b5cd72555cdb1e3f61ae92efd7d6b72 (patch)
treea001e3858f4374f3c3b708de798f375c313ddf58 /gcc/config/frv
parent532815a787849962ca2f2101aef12ec1d57b2cfd (diff)
downloadgcc-9a228f097b5cd72555cdb1e3f61ae92efd7d6b72.tar.gz
frv.c (frv_ifcvt_modify_insn): Don't leave alone scratch insns that set a register live at the join point.
* config/frv/frv.c (frv_ifcvt_modify_insn): Don't leave alone scratch insns that set a register live at the join point. From-SVN: r91344
Diffstat (limited to 'gcc/config/frv')
-rw-r--r--gcc/config/frv/frv.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index 19faaa67592..de976898d97 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -7418,10 +7418,28 @@ frv_ifcvt_modify_insn (ce_if_block_t *ce_info,
else if (frv_ifcvt.scratch_insns_bitmap
&& bitmap_bit_p (frv_ifcvt.scratch_insns_bitmap,
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))
+ /* We must not unconditionally set a scratch reg chosen
+ for a nested if-converted block if its incoming
+ value from the TEST block (or the result of the THEN
+ branch) could/should propagate to the JOIN block.
+ It suffices to test whether the register is live at
+ the JOIN point: if it's live there, we can infer
+ that we set it in the former JOIN block of the
+ nested if-converted block (otherwise it wouldn't
+ have been available as a scratch register), and it
+ is either propagated through or set in the other
+ conditional block. It's probably not worth trying
+ to catch the latter case, and it could actually
+ limit scheduling of the combined block quite
+ severely. */
+ && ce_info->join_bb
+ && ! (REGNO_REG_SET_P
+ (ce_info->join_bb->global_live_at_start,
+ REGNO (SET_DEST (set))))
+ /* Similarly, we must not unconditionally set a reg
+ used as scratch in the THEN branch if the same reg
+ is live in the ELSE branch. */
&& (! ce_info->else_bb
|| BLOCK_FOR_INSN (insn) == ce_info->else_bb
|| ! (REGNO_REG_SET_P