summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-14 18:16:07 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-10-14 18:16:07 +0000
commit805ae000ed8eb0b87f6e0e8d09bf5308710e1478 (patch)
tree0528a5ff07218adcfc96168d07f80f2555b12c8b /gcc/simplify-rtx.c
parent16ceebaec495923de6fa36493f30a629dc7a7780 (diff)
downloadgcc-805ae000ed8eb0b87f6e0e8d09bf5308710e1478.tar.gz
PR opt/8165
* gcse.c (adjust_libcall_notes): Revert last change. * simplify-rtx.c (simplify_replace_rtx): Handle LO_SUM. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58130 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index cd7e28b45c7..3293f0b7c6b 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -343,9 +343,22 @@ simplify_replace_rtx (x, old, new)
return replace_equiv_address_nv (x,
simplify_replace_rtx (XEXP (x, 0),
old, new));
+ else if (code == LO_SUM)
+ {
+ rtx op0 = simplify_replace_rtx (XEXP (x, 0), old, new);
+ rtx op1 = simplify_replace_rtx (XEXP (x, 1), old, new);
- if (REG_P (x) && REG_P (old) && REGNO (x) == REGNO (old))
- return new;
+ /* (lo_sum (high x) x) -> x */
+ if (GET_CODE (op0) == HIGH && rtx_equal_p (XEXP (op0, 0), op1))
+ return op1;
+
+ return gen_rtx_LO_SUM (mode, op0, op1);
+ }
+ else if (code == REG)
+ {
+ if (REG_P (old) && REGNO (x) == REGNO (old))
+ return new;
+ }
return x;