diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-19 12:32:23 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-11-19 12:32:23 +0000 |
commit | 3f43639e96ff5442575f15e9f21239649efafee7 (patch) | |
tree | 12bfadc14e1e9523af41c36f9907180bc2985ab0 /gcc/combine.c | |
parent | 1c9af531f1af2a9b999f17f42f30b1b4f3ee8536 (diff) | |
download | gcc-3f43639e96ff5442575f15e9f21239649efafee7.tar.gz |
* combine.c (make_compound_operation): Swap operands of
commutative operation if necessary before returning.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107219 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 9f910a7b336..b43b9b621c6 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -6914,6 +6914,16 @@ make_compound_operation (rtx x, enum rtx_code in_code) SUBST (XEXP (x, i), new); } + /* If this is a commutative operation, the changes to the operands + may have made it noncanonical. */ + if (COMMUTATIVE_ARITH_P (x) + && swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1))) + { + tem = XEXP (x, 0); + SUBST (XEXP (x, 0), XEXP (x, 1)); + SUBST (XEXP (x, 1), tem); + } + return x; } |