diff options
author | Andreas Krebbel <krebbel1@de.ibm.com> | 2006-03-16 08:15:35 +0000 |
---|---|---|
committer | Andreas Krebbel <krebbel@gcc.gnu.org> | 2006-03-16 08:15:35 +0000 |
commit | 349f4ea14a4b563b86ef48a3f4dde6643ae91226 (patch) | |
tree | bddd4255cea6140e8144f36f712a40029350ef81 /gcc | |
parent | 048d0d36c2021df68c27dcc308f8f0717f0537bf (diff) | |
download | gcc-349f4ea14a4b563b86ef48a3f4dde6643ae91226.zip gcc-349f4ea14a4b563b86ef48a3f4dde6643ae91226.tar.gz gcc-349f4ea14a4b563b86ef48a3f4dde6643ae91226.tar.bz2 |
simplify-rtx.c (simplify_plus_minus): Simplify within CONST terms.
2006-03-16 Andreas Krebbel <krebbel1@de.ibm.com>
* simplify-rtx.c (simplify_plus_minus): Simplify within CONST terms.
From-SVN: r112131
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/simplify-rtx.c | 15 |
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 579f7a3..b7870e3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2006-03-16 Andreas Krebbel <krebbel1@de.ibm.com> + + * simplify-rtx.c (simplify_plus_minus): Simplify within CONST terms. + 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * config/ia64/ia64.c (stops_p): Added explicit initialization. diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 754464d..e00e9cc 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3320,8 +3320,21 @@ simplify_plus_minus (enum rtx_code code, enum machine_mode mode, rtx op0, else if (swap_commutative_operands_p (lhs, rhs)) tem = lhs, lhs = rhs, rhs = tem; - tem = simplify_binary_operation (ncode, mode, lhs, rhs); + if ((GET_CODE (lhs) == CONST || GET_CODE (lhs) == CONST_INT) + && (GET_CODE (rhs) == CONST || GET_CODE (rhs) == CONST_INT)) + { + rtx tem_lhs, tem_rhs; + + tem_lhs = GET_CODE (lhs) == CONST ? XEXP (lhs, 0) : lhs; + tem_rhs = GET_CODE (rhs) == CONST ? XEXP (rhs, 0) : rhs; + tem = simplify_binary_operation (ncode, mode, tem_lhs, tem_rhs); + if (tem && !CONSTANT_P (tem)) + tem = gen_rtx_CONST (GET_MODE (tem), tem); + } + else + tem = simplify_binary_operation (ncode, mode, lhs, rhs); + /* Reject "simplifications" that just wrap the two arguments in a CONST. Failure to do so can result in infinite recursion with simplify_binary_operation |