summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-11 19:09:01 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-10-11 19:09:01 +0000
commit3218cd686b1c59e37ab5ec55cc1dd3dc0ab4ed00 (patch)
tree0af59fd9a7957f8015a9a3583d7558f62d298e02 /gcc/simplify-rtx.c
parent5e25c66ceab2f5a28467402b4f021a8d3ecb30a3 (diff)
downloadgcc-3218cd686b1c59e37ab5ec55cc1dd3dc0ab4ed00.tar.gz
gcc/
* simplify-rtx.c (simplify_replace_rtx): Use rtx_equal_p for all OLD_RTXes, not just REGs. Use copy_rtx to create the replacement value. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152646 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 0450ea083f4..4e87d04abaf 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -365,8 +365,8 @@ simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
to build a new expression substituting recursively. If we can't do
anything, return our input. */
- if (x == old_rtx)
- return new_rtx;
+ if (rtx_equal_p (x, old_rtx))
+ return copy_rtx (new_rtx);
switch (GET_RTX_CLASS (code))
{
@@ -445,11 +445,6 @@ simplify_replace_rtx (rtx x, const_rtx old_rtx, rtx new_rtx)
return x;
return gen_rtx_LO_SUM (mode, op0, op1);
}
- else if (code == REG)
- {
- if (rtx_equal_p (x, old_rtx))
- return new_rtx;
- }
break;
default: