summaryrefslogtreecommitdiff
path: root/gcc/loop-iv.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-28 13:58:29 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-11-28 13:58:29 +0000
commitc1987637b2b9d22c60cb265174f7198a4ef202dc (patch)
treedfb3c578630060fe190ec6899796ad170063f1cc /gcc/loop-iv.c
parentb56b2d84b37572ac5a764a6c4f98fa0c9acd7d6b (diff)
downloadgcc-c1987637b2b9d22c60cb265174f7198a4ef202dc.tar.gz
2008-11-28 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r142527 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@142258 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-iv.c')
-rw-r--r--gcc/loop-iv.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/gcc/loop-iv.c b/gcc/loop-iv.c
index 2523963f36d..3723dbd463a 100644
--- a/gcc/loop-iv.c
+++ b/gcc/loop-iv.c
@@ -1337,13 +1337,26 @@ simple_rhs_p (rtx rhs)
case MINUS:
op0 = XEXP (rhs, 0);
op1 = XEXP (rhs, 1);
- /* Allow reg + const sets only. */
- if (REG_P (op0) && !HARD_REGISTER_P (op0) && CONSTANT_P (op1))
- return true;
- if (REG_P (op1) && !HARD_REGISTER_P (op1) && CONSTANT_P (op0))
- return true;
+ /* Allow reg + const and reg + reg. */
+ if (!(REG_P (op0) && !HARD_REGISTER_P (op0))
+ && !CONSTANT_P (op0))
+ return false;
+ if (!(REG_P (op1) && !HARD_REGISTER_P (op1))
+ && !CONSTANT_P (op1))
+ return false;
- return false;
+ return true;
+
+ case ASHIFT:
+ op0 = XEXP (rhs, 0);
+ op1 = XEXP (rhs, 1);
+ /* Allow reg << const. */
+ if (!(REG_P (op0) && !HARD_REGISTER_P (op0)))
+ return false;
+ if (!CONSTANT_P (op1))
+ return false;
+
+ return true;
default:
return false;