aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorRoger Sayle <roger@eyesopen.com>2004-01-19 21:51:06 +0000
committerRoger Sayle <sayle@gcc.gnu.org>2004-01-19 21:51:06 +0000
commit9ce79a7a5ee9a5dbf634979dc17534d01459104f (patch)
tree13ca67175f8037cdb994d41ba64df008eabc1b44 /gcc/rtlanal.c
parent0916f87331e015fa7851354dd96180543f1934d6 (diff)
downloadgcc-9ce79a7a5ee9a5dbf634979dc17534d01459104f.zip
gcc-9ce79a7a5ee9a5dbf634979dc17534d01459104f.tar.gz
gcc-9ce79a7a5ee9a5dbf634979dc17534d01459104f.tar.bz2
re PR rtl-optimization/5263 (a & b & ~a & ~b not optimized)
PR optimization/5263 * simplify-rtx.c (associative_constant_p): Delete. (simplify_associative_operation): Rewrite to linearize terms, and attempt to simplify new term against both left and right subterms. (simplify_binary_operation): Call swap_commutative_operands_p on op0 and op1, not trueop0 and trueop1. Move the initialization of trueop0 and trueop1 down to where first needed. (simplify_relational_operation): Likewise. * rtlanal.c (commutative_operand_precedence): Also order constant operands using avoid_constant_pool_reference. From-SVN: r76179
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 15c4879..44a6c6c 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1,6 +1,6 @@
/* Analyze RTL for C-Compiler
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of GCC.
@@ -3023,6 +3023,11 @@ commutative_operand_precedence (rtx op)
{
/* Constants always come the second operand. Prefer "nice" constants. */
if (GET_CODE (op) == CONST_INT)
+ return -7;
+ if (GET_CODE (op) == CONST_DOUBLE)
+ return -6;
+ op = avoid_constant_pool_reference (op);
+ if (GET_CODE (op) == CONST_INT)
return -5;
if (GET_CODE (op) == CONST_DOUBLE)
return -4;