From patchwork Thu Jul 26 10:20:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Remove duplicate check on BRANCH_COST in fold-const.c Date: Thu, 26 Jul 2012 00:20:05 -0000 From: Bin Cheng X-Patchwork-Id: 173394 Message-Id: <001801cd6b18$3b7e1c00$b27a5400$@cheng@arm.com> To: Hi, This patch removes the duplicate check on BRANCH_COST in fold_truth_andor. The BRANCH_COST condition removed is a duplicate of the default definition of LOGICAL_OP_NON_SHORT_CIRCUIT. All current targets (mips and rs6000) that provide non-default definitions of LOGICAL_OP_SHORT_CIRCUIT set it to 0, so this patch is therefore just a code cleanup and does not change behaviour in the compiler. I built mipsel-elf cross compiler and compared newlib/libstdc++ compiled by the patched/original compilers. Is it OK? Thanks 2012-07-26 Bin Cheng * fold-const.c (fold_truth_andor) Remove duplicated check on BRANCH_COST. Index: gcc/fold-const.c =================================================================== --- gcc/fold-const.c (revision 189835) +++ gcc/fold-const.c (working copy) @@ -8443,9 +8443,7 @@ if ((tem = fold_truth_andor_1 (loc, code, type, arg0, arg1)) != 0) return tem; - if ((BRANCH_COST (optimize_function_for_speed_p (cfun), - false) >= 2) - && LOGICAL_OP_NON_SHORT_CIRCUIT + if (LOGICAL_OP_NON_SHORT_CIRCUIT && (code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR || code == TRUTH_OR_EXPR