From: Roger Sayle Date: Sat, 25 May 2002 16:09:20 +0000 (+0000) Subject: simplify-rtx.c (simplify_gen_relational): Simplify the RTX (cond (compare x y) 0... X-Git-Tag: releases/gcc-3.3.0~4815 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb2c68414e698e8901a522fbc007e3cd0a201a22;p=thirdparty%2Fgcc.git simplify-rtx.c (simplify_gen_relational): Simplify the RTX (cond (compare x y) 0) into the equivalent (cond x y). * simplify-rtx.c (simplify_gen_relational): Simplify the RTX (cond (compare x y) 0) into the equivalent (cond x y). From-SVN: r53870 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 86d94094bcd5..8c83eb61cc25 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-05-25 Roger Sayle + + * simplify-rtx.c (simplify_gen_relational): Simplify the RTX + (cond (compare x y) 0) into the equivalent (cond x y). + 2002-05-25 Gabriel Dos Reis * toplev.c (output_clean_symbol_name): Use xstrdup. Fix thinko. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 36bcc1a22dc1..6ec33a3935be 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -232,6 +232,10 @@ simplify_gen_relational (code, mode, cmp_mode, op0, op1) if ((tem = simplify_relational_operation (code, cmp_mode, op0, op1)) != 0) return tem; + /* If op0 is a compare, extract the comparison arguments from it. */ + if (GET_CODE (op0) == COMPARE && op1 == const0_rtx) + op1 = XEXP (op0, 1), op0 = XEXP (op0, 0); + /* Put complex operands first and constants second. */ if (swap_commutative_operands_p (op0, op1)) tem = op0, op0 = op1, op1 = tem, code = swap_condition (code);