From: Joseph Myers Date: Mon, 29 Sep 2008 19:31:27 +0000 (+0100) Subject: ifcvt.c (noce_emit_store_flag): If using condition from original jump, reverse it... X-Git-Tag: releases/gcc-4.4.0~2223 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=567075ed3155c2eaf016562367b26aa0edc2c9d6;p=thirdparty%2Fgcc.git ifcvt.c (noce_emit_store_flag): If using condition from original jump, reverse it if if_info->cond was reversed. * ifcvt.c (noce_emit_store_flag): If using condition from original jump, reverse it if if_info->cond was reversed. From-SVN: r140764 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a8d787bd86b2..8a5904f7903f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-09-29 Joseph Myers + + * ifcvt.c (noce_emit_store_flag): If using condition from original + jump, reverse it if if_info->cond was reversed. + 2008-09-29 Eric Botcazou * expr.c (expand_expr_real_1) : Force op0 to diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index 341174ab02fe..a0b49a3979c1 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -666,7 +666,15 @@ noce_emit_store_flag (struct noce_if_info *if_info, rtx x, int reversep, build the store_flag insn directly. */ if (cond_complex) - cond = XEXP (SET_SRC (pc_set (if_info->jump)), 0); + { + rtx set = pc_set (if_info->jump); + cond = XEXP (SET_SRC (set), 0); + if (GET_CODE (XEXP (SET_SRC (set), 2)) == LABEL_REF + && XEXP (XEXP (SET_SRC (set), 2), 0) == JUMP_LABEL (if_info->jump)) + reversep = !reversep; + if (if_info->then_else_reversed) + reversep = !reversep; + } if (reversep) code = reversed_comparison_code (cond, if_info->jump);