summaryrefslogtreecommitdiff
path: root/gcc/unroll.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1994-08-14 22:55:17 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1994-08-14 22:55:17 +0000
commitbd18220b61e45779e7946df878f7a660ce6f8bf0 (patch)
tree8962306cefc1fe4df756c43a6578028f0b84965f /gcc/unroll.c
parentfc6da39f442fcb3caecd26b578a6d8568ec0ce90 (diff)
downloadgcc-bd18220b61e45779e7946df878f7a660ce6f8bf0.tar.gz
(calculate_giv_inc): Handle constants loaded with IOR.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@7918 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unroll.c')
-rw-r--r--gcc/unroll.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 9b968ac9696..fafa627e24d 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -1335,11 +1335,27 @@ calculate_giv_inc (pattern, src_insn, regno)
one of the LO_SUM rtx. */
if (GET_CODE (increment) == LO_SUM)
increment = XEXP (increment, 1);
+ else if (GET_CODE (increment) == IOR)
+ {
+ /* The rs6000 port loads some constants with IOR. */
+ rtx second_part = XEXP (increment, 1);
+
+ src_insn = PREV_INSN (src_insn);
+ increment = SET_SRC (PATTERN (src_insn));
+ /* Don't need the last insn anymore. */
+ delete_insn (get_last_insn ());
+
+ if (GET_CODE (second_part) != CONST_INT
+ || GET_CODE (increment) != CONST_INT)
+ abort ();
+
+ increment = GEN_INT (INTVAL (increment) | INTVAL (second_part));
+ }
if (GET_CODE (increment) != CONST_INT)
abort ();
- /* The insn loading the constant into a register is not longer needed,
+ /* The insn loading the constant into a register is no longer needed,
so delete it. */
delete_insn (get_last_insn ());
}