summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-06 22:14:43 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-06 22:14:43 +0000
commit2a9870bd4c21a53bb1fad26248764444e0d67585 (patch)
treee092e83c22a3a8cf7bfdb46857702de8b9cbd22d /gcc/simplify-rtx.c
parentf5c9ea10921f63acfd0fe9e322efbcc960c97f4d (diff)
downloadgcc-2a9870bd4c21a53bb1fad26248764444e0d67585.tar.gz
* simplify-rtx.c (simplify_binary_operation): Simplify contents
of CONST. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45447 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index ea1cc6d285a..7f358d3ddc4 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1275,6 +1275,28 @@ simplify_binary_operation (code, mode, op0, op1)
return simplify_gen_binary (AND, mode, op0,
gen_rtx_NOT (mode, XEXP (op1, 0)));
}
+
+ /* Simplify operations with constants containing embedded offsets. */
+ if (GET_CODE (op0) == CONST)
+ {
+ tem = simplify_binary_operation (code, mode, XEXP (op0, 0), op1);
+ if (tem)
+ {
+ if (CONSTANT_P (op1) && ! CONSTANT_P (tem))
+ tem = gen_rtx_CONST (mode, tem);
+ return tem;
+ }
+ }
+ if (GET_CODE (op1) == CONST)
+ {
+ tem = simplify_binary_operation (code, mode, op0, XEXP (op1, 0));
+ if (tem)
+ {
+ if (CONSTANT_P (op0) && ! CONSTANT_P (tem))
+ tem = gen_rtx_CONST (mode, tem);
+ return tem;
+ }
+ }
break;
case MULT: