From 2e73b8fe52035fffbcb666f9017ff06a84dc09cf Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Mon, 28 Sep 2015 08:25:36 +0000 Subject: [PATCH] [RTL-ifcvt] PR rtl-optimization/67481: Look more deeply for CCmode sets during if-covnersion PR rtl-optimization/67481 * ifcvt.c (contains_ccmode_rtx_p): New function. (insn_valid_noce_process_p): Use it. From-SVN: r228195 --- gcc/ChangeLog | 6 ++++++ gcc/ifcvt.c | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b3419b62f00..32875dfca72 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-09-28 Kyrylo Tkachov + + PR rtl-optimization/67481 + * ifcvt.c (contains_ccmode_rtx_p): New function. + (insn_valid_noce_process_p): Use it. + 2015-09-28 Kyrylo Tkachov PR rtl-optimization/67456 diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 2b63216b9dd..7ab738ec0e2 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -1761,6 +1761,19 @@ noce_try_cmove (struct noce_if_info *if_info) return FALSE; } +/* Return true if X contains a conditional code mode rtx. */ + +static bool +contains_ccmode_rtx_p (rtx x) +{ + subrtx_iterator::array_type array; + FOR_EACH_SUBRTX (iter, array, x, ALL) + if (GET_MODE_CLASS (GET_MODE (*iter)) == MODE_CC) + return true; + + return false; +} + /* Helper for bb_valid_for_noce_process_p. Validate that the rtx insn INSN is a single set that does not set the conditional register CC and is in general valid for @@ -1779,6 +1792,7 @@ insn_valid_noce_process_p (rtx_insn *insn, rtx cc) /* Currently support only simple single sets in test_bb. */ if (!sset || !noce_operand_ok (SET_DEST (sset)) + || contains_ccmode_rtx_p (SET_DEST (sset)) || !noce_operand_ok (SET_SRC (sset))) return false; -- 2.30.2