diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2009-10-11 19:09:01 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2009-10-11 19:09:01 +0000 |
commit | c47d1dbaeb4f5ed3d09d1f440fb3a513e8ad73d3 (patch) | |
tree | 0af59fd9a7957f8015a9a3583d7558f62d298e02 /gcc/simplify-rtx.c | |
parent | 3c6d5e12dd0ffd98659bae850681c17e80d883ec (diff) | |
download | gcc-c47d1dbaeb4f5ed3d09d1f440fb3a513e8ad73d3.zip gcc-c47d1dbaeb4f5ed3d09d1f440fb3a513e8ad73d3.tar.gz gcc-c47d1dbaeb4f5ed3d09d1f440fb3a513e8ad73d3.tar.bz2 |
simplify-rtx.c (simplify_replace_rtx): Use rtx_equal_p for all OLD_RTXes, not just REGs.
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.
From-SVN: r152646
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 0450ea0..4e87d04 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: |