diff options
author | Peter Bergner <bergner@vnet.ibm.com> | 2007-07-23 11:43:24 -0500 |
---|---|---|
committer | Peter Bergner <bergner@gcc.gnu.org> | 2007-07-23 11:43:24 -0500 |
commit | 7e0b4eaea174caaaae3a50074623b58d1cdfe410 (patch) | |
tree | ff49113424954fc128f22d29310fdf6c0c984bbc /gcc/rtlanal.c | |
parent | de2b3a07713724618330b6bde404a32d0af811c0 (diff) | |
download | gcc-7e0b4eaea174caaaae3a50074623b58d1cdfe410.zip gcc-7e0b4eaea174caaaae3a50074623b58d1cdfe410.tar.gz gcc-7e0b4eaea174caaaae3a50074623b58d1cdfe410.tar.bz2 |
PR middle-end/PR28690
PR middle-end/PR28690
* optabs.c (expand_binop): (emit_cmp_and_jump_insns): Allow EQ compares.
* rtlanal.c (commutative_operand_precedence): Prefer both REG_POINTER
and MEM_POINTER operands over REG and MEM operands.
(swap_commutative_operands_p): Change return value to bool.
* rtl.h: Update the corresponding prototype.
* tree-ssa-address.c (gen_addr_rtx): Use simplify_gen_binary
instead of gen_rtx_PLUS.
* simplify-rtx.c (simplify_plus_minus_op_data_cmp): Change return
value to bool. Change function arguments to rtx's and update code
to match.
(simplify_plus_minus): Update the simplify_plus_minus_op_data_cmp
calls to match the new declaration.
* simplify-rtx.c (simplify_associative_operation): Don't
reorder simplify_binary_operation arguments.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r126852
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r-- | gcc/rtlanal.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 9535104..d948a08 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -2877,9 +2877,9 @@ commutative_operand_precedence (rtx op) /* Constants always come the second operand. Prefer "nice" constants. */ if (code == CONST_INT) - return -7; + return -8; if (code == CONST_DOUBLE) - return -6; + return -7; op = avoid_constant_pool_reference (op); code = GET_CODE (op); @@ -2887,22 +2887,24 @@ commutative_operand_precedence (rtx op) { case RTX_CONST_OBJ: if (code == CONST_INT) - return -5; + return -6; if (code == CONST_DOUBLE) - return -4; - return -3; + return -5; + return -4; case RTX_EXTRA: /* SUBREGs of objects should come second. */ if (code == SUBREG && OBJECT_P (SUBREG_REG (op))) - return -2; - + return -3; return 0; case RTX_OBJ: /* Complex expressions should be the first, so decrease priority - of objects. */ - return -1; + of objects. Prefer pointer objects over non pointer objects. */ + if ((REG_P (op) && REG_POINTER (op)) + || (MEM_P (op) && MEM_POINTER (op))) + return -1; + return -2; case RTX_COMM_ARITH: /* Prefer operands that are themselves commutative to be first. @@ -2929,7 +2931,7 @@ commutative_operand_precedence (rtx op) /* Return 1 iff it is necessary to swap operands of commutative operation in order to canonicalize expression. */ -int +bool swap_commutative_operands_p (rtx x, rtx y) { return (commutative_operand_precedence (x) |