aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2006-01-07 22:23:27 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2006-01-07 17:23:27 -0500
commit68162a976669a165633f4905f0ab1d60962b0666 (patch)
tree1fe479be7d0037272b7c2cdc78e67963de5da542 /gcc
parent8c7ffa93a8988b2e10d7b49913f55201575d3ca5 (diff)
downloadgcc-68162a976669a165633f4905f0ab1d60962b0666.zip
gcc-68162a976669a165633f4905f0ab1d60962b0666.tar.gz
gcc-68162a976669a165633f4905f0ab1d60962b0666.tar.bz2
re PR target/25662 (Unrecognizable insn with -O on PPC)
2005-01-07 Ian Lance Taylor <ian@airs.com> David Edelsohn <edelsohn@gnu.org> PR rtl-optimization/25662 * optabs.c (simplify_expand_binop): Use simplify_binary_operation for constant operands instead of simplify_gen_binary. * simplify-rtx.c (simplify_gen_binary): Swap commutative operands after trying simplify_binary_operation Co-Authored-By: David Edelsohn <edelsohn@gnu.org> From-SVN: r109456
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog9
-rw-r--r--gcc/optabs.c11
-rw-r--r--gcc/simplify-rtx.c10
3 files changed, 22 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 428c523..f4a023c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2005-01-07 Ian Lance Taylor <ian@airs.com>
+ David Edelsohn <edelsohn@gnu.org>
+
+ PR rtl-optimization/25662
+ * optabs.c (simplify_expand_binop): Use simplify_binary_operation
+ for constant operands instead of simplify_gen_binary.
+ * simplify-rtx.c (simplify_gen_binary): Swap commutative operands
+ after trying simplify_binary_operation
+
2006-01-06 Daniel Berlin <dberlin@dberlin.org>
* tree.c (iterative_hash_expr): Hash decls based on UID.
diff --git a/gcc/optabs.c b/gcc/optabs.c
index d79cf66..349a922 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -427,9 +427,14 @@ simplify_expand_binop (enum machine_mode mode, optab binoptab,
enum optab_methods methods)
{
if (CONSTANT_P (op0) && CONSTANT_P (op1))
- return simplify_gen_binary (binoptab->code, mode, op0, op1);
- else
- return expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods);
+ {
+ rtx x = simplify_binary_operation (binoptab->code, mode, op0, op1);
+
+ if (x)
+ return x;
+ }
+
+ return expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods);
}
/* Like simplify_expand_binop, but always put the result in TARGET.
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index c773900..5a5c5ca 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -114,16 +114,16 @@ simplify_gen_binary (enum rtx_code code, enum machine_mode mode, rtx op0,
{
rtx tem;
- /* Put complex operands first and constants second if commutative. */
- if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
- && swap_commutative_operands_p (op0, op1))
- tem = op0, op0 = op1, op1 = tem;
-
/* If this simplifies, do it. */
tem = simplify_binary_operation (code, mode, op0, op1);
if (tem)
return tem;
+ /* Put complex operands first and constants second if commutative. */
+ if (GET_RTX_CLASS (code) == RTX_COMM_ARITH
+ && swap_commutative_operands_p (op0, op1))
+ tem = op0, op0 = op1, op1 = tem;
+
return gen_rtx_fmt_ee (code, mode, op0, op1);
}